#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>

#define ll long long

int main(){
	ll n;
	scanf("%lld", &n);
	ll input[n];
	for(ll i = 0; i < n; i++) scanf("%d", input + i);
	ll result = 0;
	//for(int i = 0; i < n; i++) mult[i] = std::vector<int>(n, 0);
	/*
	for(int i = 0; i < n; i++){
		mult[i][1] = input[i];
        for(int j = 1; j <= i; j++){
			mult[i][j] *= input[i];
			if(mult[i][j] % 2 == 0) result++;
        }
	}
	*/
	for(ll i = 0; i < n - 1; i++){
		ll current;
		if(input[i] % 2 == 0){current = 2; result++;}
		else current = 1;
        for(int j = i + 1; j < n; j++){
			if(input[i] % 2 == 0) current = 2;
			if(current == 2) result++;
        }
	}
	printf("%d", result);
	//system("pause");
	return 0;
}
