#include <bits/stdc++.h>
using namespace std;
long long a[200009];
long long b[200009];
map<long long, long long> mp;
map<long long, long long> mp1;
vector<long long> vc;
int main() {
  cin.sync_with_stdio(false);
  long long i, j, k, l, c, v, n, m, r, t;
  long long x1, x2, y1, y2, x3, x4, x5, x6;
  string s, s1, s2, s3, ss[10009];
  while (cin >> n) {
    cin >> s;
    c = 0;
    for (i = 0; i < n; i++) {
    }
    j = 1;
    for (i = 0; i < n; i++) {
      if ((s[i] - 48) % 2 == 0) {
        c += j;
      }
      j++;
    }
    cout << c;
  }
}
