using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace slova
{
    class Program
    {
        static void Main(string[] args)
        {
            int x=0;
            int N =/* Convert.ToInt32(Console.ReadLine())*/27;
            
            string betuk = /*Console.ReadLine()*/"AABCDEFGHIJKLMNOPQRSTUVWXYZ";
            if (N <= 26)
            {
                x = 0;
            }
            else
            {
                foreach (char c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
                {
                    if (betuk.IndexOf(c) != betuk.LastIndexOf(c))
                    {
                        if (betuk.Remove(betuk.IndexOf(c),1) == "ABCDEFGHIJKLMNOPQRSTUVWXYZ") x++;
                        if (betuk.Remove(betuk.LastIndexOf(c),1) == "ABCDEFGHIJKLMNOPQRSTUVWXYZ") x++;
                    }
                }
            }
            Console.WriteLine(x);
            Console.ReadLine();
        }
    }
}