#include <bits/stdc++.h>
#define MAX_N 10005
using namespace std;

int chisla[MAX_N];
vector <int> index_chetni;

int main()
{
    int n;
    cin >> n;

    for(int i=1; i<=n; i++)
    {
        cin >> chisla[i];
        if(chisla[i]%2==0)
        {
            index_chetni.push_back(i);
        }
    }
    int k;
    long long result=0;
    for(int i=0; i<index_chetni.size()-1; i++)
    {
        result+=index_chetni[i]*(index_chetni[i+1]-index_chetni[i]);

    }
    result+=index_chetni[index_chetni.size()-1]*(n-index_chetni[index_chetni.size()-1]+1);

    cout << result;

    return 0;
}
