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