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

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