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