#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char *s = new char[n];
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (int(s[i] - 48) % 2 == 0) count += i + 1;
  }
  cout << count << endl;
  return 0;
}
