#include <bits/stdc++.h>
using namespace std;
int n , a , s , f , j;
int main()
{
cin >> n;
for ( int i = 1; i <= n; i++ )
{
cin >> a;//12345
s = s + a / 100;
f = f + a % 100 / 10 ;
j = j + a % 10;
}
cout << s << endl << f << endl << j << endl;
return 0;
}