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