#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const int MOD = 1000000007;
bool isPowerOfTwo(long long int x) { return x && (!(x & (x - 1))); }
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
int main() {
  fastio();
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans = 0;
    for (int i = 0; i < (s.length()); i++) {
      int x = int(s[i]) - 48;
      if (x % 2 == 0) ans += (i + 1);
    }
    cout << ans << "\n";
  }
  return 0;
}
