#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  string s;
  cin >> n >> s;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if ((s[i] - '0') % 2 == 0) {
      ans += i + 1;
    }
  }
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout.precision(30);
  long long t = 1;
  while (t--) {
    solve();
  }
}
