#include <bits/stdc++.h>
using namespace std;
int main()
{
    ifstream f1("CHANLE.INP");
    long long a[10000],n,i;
    f1>>n;
    for(i=0;i<n;i++)
    {
       f1>>a[i];
    }
    f1.close();
    long long dem1=0,dem2=0,tong1=0,tong2=0;
    ofstream f2("CHANLE.OUT");
    for(i=0;i<n;i++)
    {
        if(a[i]!=0)
        {
            if(a[i]%2==0){dem1++;
            tong1+=a[i];}
            else {
            dem2++;
            tong2+=a[i];}
        }
    }
    f2<<tong1<<" "<<dem1<<endl;
    f2<<tong2<<" "<<dem2;
    f2.close();
}
