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