#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, count = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; s[i] != '\0'; i++) {
    int temp = s[i] - '0';
    if (temp % 2 == 0) count += (i + 1);
  }
  cout << count << endl;
  return 0;
}
