#include <bits/stdc++.h>
using namespace std;
const long long maxx = 1e6 + 7;
const long long maxn = 300000 + 7;
const long long mod = 1e9 + 7;
const long long maxs = 5 * (1E5) + 7;
const long long maxm = 4e5 + 7;
const long long maxk = 1008 + 7;
const long long maxw = 100 + 7;
const long long maxh = 100 + 7;
const double pi = 3.1415926;
const long long ten = 10;
const int ooi = 1234567;
const long long ool = 1e18 + 7;
const long double eps = 1e-8;
const int apsz = 26;
string ss;
void init() {
  int n;
  cin >> n;
  cin >> ss;
  long long ans = 0;
  for (long long i = ((int)ss.length() - 1); i >= (0); i--) {
    int tt = ss[i] - '0';
    if (tt % 2) continue;
    ans += (i + 1);
  }
  cout << ans << endl;
}
void solve() {}
int main(void) {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  init();
  solve();
  return 0;
}
