#include <bits/stdc++.h>
const int MOD = 1000000007;
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long powM(long long a, long long n, long long m) {
  if (!n) return 1;
  long long x = powM(a, n >> 1, m);
  x = x * x % m;
  if (n & 1) x = (x * a) % m;
  return x;
}
int myIntMin(int a, int b) { return a <= b ? a : b; }
long long int myllIntMin(long long int a, long long int b) {
  return a <= b ? a : b;
}
void myFactorial(long long int n, vector<long long int> &dp) {
  long long int f = 1;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    f = (f * i);
    dp[i] = f;
  }
}
void myFactorialMod(long long int n, vector<long long int> &dp) {
  long long int f = 1;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    f = (f * i) % MOD;
    dp[i] = f;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    long long int ans = 0;
    for (int i = 0; i < n; ++i) {
      if ((s[i] - '0') % 2 == 1)
        continue;
      else
        ans += i + 1;
    }
    cout << ans << endl;
  }
  return 0;
}
