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