#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[65005];
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if ((a[i] - '0') % 2 == 0) sum += i;
  }
  cout << sum;
  return 0;
}
