#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0;
  cin >> n;
  char a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == '2') {
      c++;
      c += i;
    } else if (a[i] == '4') {
      c++;
      c += i;
    } else if (a[i] == '6') {
      c++;
      c += i;
    } else if (a[i] == '8') {
      c++;
      c += i;
    }
  }
  cout << c << "\n";
  return 0;
}
