#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  for (long long i = 0; i < s.size(); ++i) {
    if ((s[i] - '0') % 2 == 0) {
      ans += i + 1;
    }
  }
  cout << ans;
}
