import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
int result = lastWordLenth(str);
System.out.println(result);
}
public static int lastWordLenth(String word) {
int emptyIndex = word.lastIndexOf(" ");
String lastWord = word.substring(emptyIndex + 1, word.length());
return lastWord.length();
}
}