#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  while (cin >> n >> s) {
    int sz = s.size(), i;
    long long int ans = 0;
    for (i = 0; i < sz; i++) {
      char a = s[i];
      if (a == '2' || a == '4' || a == '6' || a == '8' || a == '0') {
        ans += (i + 1);
      }
    }
    cout << ans << endl;
  }
}
