#include <bits/stdc++.h>
using namespace std;
int main() {
  long long kol;
  cin >> kol;
  string s;
  cin >> s;
  vector<long long> ks;
  long long sum = 0;
  char ss[kol];
  for (long long i = 0; i < kol; ++i) ss[i] = s[i];
  for (long long i = 0; i < kol; ++i) ks.push_back(((int)ss[i] - 48));
  for (long long i = 1; i <= kol; ++i) {
    if (ks[i - 1] % 2 == 0) sum += i;
  }
  cout << sum;
}
