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