#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    ifstream f1("chanle.inp");
    long a[1000000];
    long n;
    long dem1=0,dem2=0,tong1=0,tong2=0;
    f1>>n;
    for(long i=1;i<=n;i++){
        f1>>a[i];
    }
    f1.close();
    for(long j=1;j<=n;j++){
        if(a[j]%2==0){
            dem1=dem1+1;
            tong1=tong1+a[j];
        }
    }
    for(long k=1;k<=n;k++){
        if(a[k]%2!=0){
            dem2=dem2+1;
            tong2=tong2+1;
        }
    }
    ofstream f2("chanle.out");
    f2<<tong1<<" "<<dem1<<endl;
    f2<<tong2<<" "<<dem2;
    f2.close();
}
