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