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