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