#include <bits/stdc++.h>
using namespace std;
int main() {
  int T = 1;
  while (T--) {
    int n;
    std::cin >> n;
    std::string s;
    std::cin >> s;
    long long int count = 0;
    for (int i = 0; i < n; ++i) {
      if ((int)(s[i] - '0') % 2 == 0) {
        count += i + 1;
      }
    }
    std::cout << count << std::endl;
  }
  return 0;
}
