using System;
public class Program
{
public static void Main()
string str = Console.ReadLine();
int br=0;
for (int i=0; i< str.Length;i++)
if (str[i]>='A' && str[i]<='Z' || str[i]>='А' && str[i]<='Я')
br++;
}
Console.WriteLine(br);