#include<iostream>
#define endl '\n'
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,ch,lchin=0,br=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>ch;
        if(ch%2==0) lchin=i;
        br+=lchin;
    }
    cout<<br<<endl;
}