#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

// E * E = E
// E * O = E
// O * O = O

int main(){
    int size;
    cin >> size;
    int arr[size] = {0};
    for(int i = 0; i < size; ++i){
        scanf("%d", &arr[i]);
    }

    long long counter = 0;
    int calc = 0;

    /*
    for(int i = 0; i < size; ++i){
        for(int j = i + 1; j < size; ++j){
            if(arr[i] % 2 == 0)
                ++counter;
            if((arr[i] * arr[j]) % 2 == 0)
                ++counter;

        }
    }
    */

    // maybe better -

    for(int i = 0; i < size; ++i){
        if(arr[i] % 2 == 0){
            counter += i;
            counter += size - i - 1;
            counter += i * (size - i - 1);
            cout << i << size - i << i * (size - i - 1);
        }
    }

    cout << counter;
    return 0;
}
