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