#include <bits/stdc++.h>
using namespace std;

string N,niz[10000],slova;
int br,y;

int main(){
    cin >> br >> slova;

    if(br == 26 && slova == "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
      cout << "1";

    else if(br < 26)
      cout << "0";

    else cout << "2";

    return 0;
}