#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double pi = acos(-1), eps = 1e-8;
const int maxn = 1 << 17;
const int N = 2e6 + 10, M = 2e7 + 10, mod = 998244353;
int n, m;
int main() {
  cin >> n;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%1d", &m);
    if (m % 2 == 0) ans += i;
  }
  cout << ans;
  return 0;
}
