#include<stdio.h>
//#include<math.h>

int main(){

    int n, beg, end, redici, even = 0;

    scanf("%d", &n);

    int nums[n];

    for(int i = 0; i<n; i++){
        scanf("%d", &nums[i]);
    }

    for(int i = 0; i<n; i++){
        if(nums[i] % 2 == 0){
           even++;
           beg = i;
           end = n - 1 - i;
           redici = beg * end + beg + end;
        }
    }

    redici = redici + even;

    printf("%d", redici);

    return 0;
}
