#include <bits/stdc++.h>
using namespace std;
const int NMAX = 65005;
int n;
string s;
long long ans = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; ++i)
    if ((int)(s[i] - '0') % 2 == 0) ans += i + 1;
  cout << ans << "\n";
  return 0;
}
