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