#include <iostream>
using namespace std;
int main() {
int n;
int sum = 0;
cin >> n;
int arr[100000];
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum += arr[i];
}
while (sum >= 10) {
sum/= 10;
}
cout << sum << endl;
return 0;
}