#include<iostream>

using namespace std;

const int MAX = 1e4 + 3;

int arr[MAX];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;

    for(int i = 0;i < n;i++)
        cin >> arr[i];


    int out = 0;
    for(int i = 0;i < n;i++)
    {
        long long curr = arr[i];
        if(curr % 2 == 0) out++;
        for(int j = i + 1;j < n;j++)
        {
            curr *= arr[j];
            if(curr % 2 == 0)
            {
                out += n - j;
                break;
            }
        }
    }

    cout << out;

    return 0;
}
