#include <bits/stdc++.h>
int main(void) {
  int n, i, out = 0;
  scanf("%d", &n);
  char s[n];
  scanf("%s", &s);
  for (i = 0; i < n; i++)
    if ((s[i] - '0') % 2 == 0) out += i + 1;
  printf("%d", out);
  return 0;
}
