#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int j = 0;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '2' or s[i] == '4' or s[i] == '6' or s[i] == '8') {
      j = i + 1;
      sum += j;
    } else
      continue;
  }
  cout << sum << "\n";
}
