#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b = 0, item, c = 0, sum = 0, vis[65500];
  char ara[65000];
  scanf("%lld%s", &a, ara);
  for (long long int i = 0; i < a; i++) {
    int no = ara[i] - '0';
    if (no % 2 == 0) {
      sum = sum + i + 1;
    }
  }
  cout << sum << endl;
  return 0;
}
