#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << x << '\n';
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int ans = 0;
for (int i = 1; i <= 9; i++) {
int x; cin >> x;
ans += x;
}
for (int i = 1; i <= 8; i++) {
int x; cin >> x;
ans -= x;
}
cout << ans + 1 << '\n';
return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << x << '\n';
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n; cin >> n;
vector <string> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++) {
string b; cin >> b;
for (int j = 0; j < n; j++) {
if (a[i][j] != b[j]) {
cout << i + 1 << ' ' << j + 1 << '\n';
}
}
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << x << '\n';
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n; cin >> n;
vector <int> ver;
for (int i = 0; i < n; i++) {
int x; cin >> x;
ver.push_back(x);
while (ver.size() >= 2 && ver.back() == ver[ver.size() - 2]) {
ver.pop_back();
ver.back() ++;
}
}
cout << ver.size() << '\n';
return 0;
}