#include<iostream>
using namespace std;
int main() {
int n, x, total = 0, min = 10, nrcase = 0, c;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> x;
c = x % 10 + x / 10 % 10 + x / 100;
total += c;
if (c < min) {
min = c;
nrcase = 1;
} else
if (c == min)
nrcase++;
}
cout << total << endl << min << endl << nrcase;
return 0;
}