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