#include <iostream>
using namespace std;
#define endl '\n'
#define int long long
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int last = -1;
    int br; cin >> br;
    int sum = 0;
    for(int i = 0; i < br; ++i){
        int input; cin >> input;
        if(input % 2 == 0){
            sum += (i + 1); last = i;
        }
        else{
            if(last != -1) sum += (last + 1);
        }
    }
    cout << sum << endl;
}
