import java.util.; import java.io.; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = in.readLine(); int len = str.length() -1; int num = 0; while(len >= 0 &&str.charAt(len) != ' '){ num ++; --len; } System.out.println(num); // String[] s = str.split(" "); // int len = s.length; // System.out.println(s[len -1].length()); } }