#include <bits/stdc++.h>
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
using namespace std;
int cases, ct = 0;
int main() {
  string a;
  int n;
  while (cin >> n) {
    cin >> a;
    int i, j, k, res = 0;
    for (i = 0; i < a.size(); i++) {
      if ((a[i] - 48) % 2 == 0) {
        res += i + 1;
      }
    }
    cout << res << endl;
  }
}
