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