#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    long long int n, i, arr[200005];
    string s;
    cin >> n;
    cin >> s;
    long long int ans = 0;
    for (i = 0; i < n; i++) {
      int p = s[i] - 48;
      if (p % 2 == 0) {
        ans += i + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
