#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(ll i = 0; i < n; i++){
		ll current = 1;
		//if(input[i] % 2 == 0){current = 2; result++;}
        for(int j = i; j < n; j++){
			if(input[j] % 2 == 0) current = 2;
			if(current == 2) result++;
        }
	}
	printf("%d", result);
	//system("pause");
	return 0;
}
