#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(const vector<T> &a) {
  for (T x : a) cout << x << " ";
  cout << '\n';
}
const long long sze = 3e5 + 50, oo = 1e18 + 500, mod = 1e9 + 7;
const long double eps = 1e-9, PI = 2 * acos(0.0);
vector<long long> vertices[sze];
vector<char> visit(sze, false);
vector<char> used(sze, false);
vector<long long> arr(sze, 0);
long long n, m, k;
long long A, B;
long long cnt = 0;
signed main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    long long val = s[i] - '0';
    if (!(val & 1)) {
      cnt += i + 1;
    }
  }
  cout << cnt;
  return 0;
}
