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