#include <bits/stdc++.h>
using namespace std;
long long a[1000],n,i,t,dem,s;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t=0;
dem=0;
s=1;
for (i=1; i<=n; i++)
{
if (a[i]%2==0) t+=a[i];
if (a[i]%5==2) dem++;
if (a[i]%7==3) s*=a[i];
}
cout<<t<<endl;
cout<<dem<<endl;
cout<<s;
return 0;
}