#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int n;
  scanf("%d", &n);
  cin >> str;
  long long cnt = 0;
  for (int i = 0; i < str.length(); i++)
    if ((str[i] - '0') % 2 == 0) cnt += i + 1;
  cout << cnt << endl;
}
