using namespace std;
#include<string>
#include <iostream>
int main(){
int n,x,sum=0;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> x;
sum = sum + x;
}
while (sum>=10)
{
sum = sum / 10;
}
cout << sum;
}