#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e3 + 10;
int main() {
  string str;
  int n;
  cin >> n;
  cin >> str;
  long long ans = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] & 1) continue;
    ans += i + 1;
  }
  cout << ans << endl;
  return 0;
}
