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