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