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