#include <bits/stdc++.h>
using namespace std;
const int N = 65004;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  char s[N];
  cin >> s;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    if (((s[i] - '0') & 1) == 0) {
      ans += i + 1;
    }
  }
  cout << ans;
  return 0;
}
