#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int t;
int fD;
int sD;
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> t;
if (t > 9) {
fD = t / 10;
sD = t % 10;
fD += sD;
sum += fD;
}
else {
sum += t;
}
}
if (sum > 9) {
fD = sum / 10;
sD = sum % 10;
sum = fD + sD;
}
cout << sum << endl;
return 0;
}