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