#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e9 + 9;
const int MIN = -1e9;
const int N = 1e5 + 9;
const double PI = 3.14159265;
int n;
int ans = 0;
string number;
int main() {
  clock_t start;
  cin >> n;
  cin >> number;
  for (int i = 0; i < number.length(); i++) {
    if ((number[i] - '0') % 2 == 0) {
      ans += i + 1;
    }
  }
  cout << ans << endl;
  cerr << "Time: " << (clock() - start) / (double)(CLOCKS_PER_SEC / 1000)
       << " ms" << endl;
  return 0;
}
