#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;
    unsigned long long ans = 0;
    for (int i = 0; i < n; i++)
        if (((s[i] - '0') & 1) ^ 1)
            ans += i + 1;
    cout << ans << endl;
    return 0;
}