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