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