#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int ch = 'a', nEven = 0, nOdd = 0, sum = 0;
  while (ch != EOF) {
    ch = getchar();
    if (ch == '0' || ch == '2' || ch == '4' || ch == '6' || ch == '8') {
      sum += nOdd + nEven;
      nEven++;
    }
    if (ch == '1' || ch == '3' || ch == '5' || ch == '7' || ch == '9') nOdd++;
  }
  printf("%d\n", sum + nEven);
}
