#include <bits/stdc++.h>
using namespace std;
int main() {
  string abc;
  int v;
  cin >> v;
  cin.ignore();
  getline(cin, abc);
  int coun = 0;
  for (int j = v - 1; j >= 0; --j) {
    if ((abc[j] == '2') or (abc[j] == '4') or (abc[j] == '6') or
        (abc[j] == '8'))
      coun += j + 1;
  }
  cout << coun;
  return 0;
}
