#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
int oo = 0x3f3f3f3f;
void start() {
  cout << fixed << setprecision(2);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int min(int x, int y, int z) { return min(min(x, y), z); }
int max(int x, int y, int z) { return max(max(x, y), z); }
vector<int> sums;
int miny = INT_MAX;
int sul(char *str, int n) {
  int len = n;
  int cnt = 0;
  for (int i = 0; i < len; i++) {
    int temp = str[i] - '0';
    if (temp % 2 == 0) cnt += (i + 1);
  }
  return cnt;
}
int main() {
  start();
  int n;
  cin >> n;
  char arr[n];
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    arr[i] = c;
  }
  cout << sul(arr, n);
  return 0;
}
