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