#include <bits/stdc++.h>
int main() {
  int n, sum = 0;
  char a[65010];
  scanf("%d", &n);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &a[i]);
    if (a[i] % 2 == 0) sum = sum + 1 + i;
  }
  printf("%d", sum);
}
