#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int a;
  cin >> a;
  string s;
  cin >> s;
  unsigned int c = 0;
  for (int unsigned i = 0; i < a; i++) {
    if (s[i] % 2 == 0) {
      c = c + i + 1;
    }
  }
  cout << c;
  return 0;
}
