#include <bits/stdc++.h>
using namespace std;
int v[1005], i, n;
long long p = 1, s;
int main()
{
ifstream f("vector.in");
ofstream g("vector.out");
f >> n;
for(i = 1; i <= n; i ++)
{
f >> v[i];
if(v[i] % 10 == 1) s = s + v[i], p = p * v[i];
}
g << s << "\n" << p;
return 0;
}