#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = (int)3e5 + 5;
int n;
char s[MAXN];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if ((s[i] - '0') % 2 == 0) ans += i;
  cout << ans << endl;
  return 0;
}
