#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

int ways(string &s, int n, int idx = 0)
{
    if (idx > n)
        return 1;
    if (s[idx] == '0')
        return 0;

    int count = ways(s, n, idx + 1);
    if (idx + 1 < n)
    {
        int num = stoi(s.substr(idx, 2));
        if (num >= 10 && num <= 26)
            count += ways(s, n, idx + 2);
    }

    return count;
}

vector<bool> used;
int numDecodings(string &s)
{
    int n = (int)s.size();
    used.resize(n, false);
    return ways(s, n);
}

int main()
{
    int n;
    cin >> n;
    string code;
    cin >> code;
    cout << numDecodings(code) << endl;
    return 0;
}