import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); String str = in.nextLine(); int n = str.length()-1; int sum = 0; for(int i = n;i >= 0;i --){ if(str.charAt(i) != ' '){ sum ++; }else{ break; } } System.out.println(sum); } }