#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
const long long INF_LL = 1e18;
using namespace std;
char s[65005];
long long cnt = 0;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if ((s[i] - '0') % 2 == 0) cnt = cnt + i + 1;
  }
  cout << cnt;
  return 0;
}
