#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int arr[n + 1];
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    char ch;
    cin >> ch;
    arr[i + 1] = ch - '0';
    if (arr[i + 1] % 2 == 0) sum += i + 1;
  }
  cout << sum << endl;
}
