using System;
using System.Collections.Generic;

namespace SLOVA
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            if(s.Length <= 26)
            {
                Console.WriteLine("0");
                return;
            }

            List<char> nizs = new List<char>(s);
            if(s.Length == 27)
            {
                int br = 0;
                int j = 0;
                for (int i = 0; i < 27; i++)
                {
                    char c = (char)(j + 65);
                    if (nizs[i] != c)
                    {
                        br++;
                        j--;
                        if (br >= 2)
                            break;
                    }
                    j++;
                }
                if (br == 1)
                    Console.WriteLine("1");
                else
                    Console.WriteLine("0");
            }
        }
    }
}