#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char a[100100];
  long long sol = 0;
  scanf("%d ", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%c ", &a[i]);
    a[i] -= '0';
    if (a[i] % 2 == 0) {
      sol += i;
    }
  }
  cout << sol << endl;
  return 0;
}
