#include <iostream>
using namespace std;
long long sbor [1000000];
long long s=1;
long long br=0;
int main (){
short n;
cin>>n;
sbor[0]=1;
short mas[n];
for (short i=0; i<n; i++) cin>>mas[i];
for (short i=0; i<n-1; i++){
    s=1;
    for (short q=i; q<n; q++){
    if ((sbor[s-1]*mas[q])%2==0){
    sbor[s]=sbor[s-1]*mas[q];
    s++;
    br++;
    }
    }
}
cout<<br;
return 0;
}
