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