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