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