public class Solution {
    public static void main(String[] args) throws IOException {
        //напишите тут ваш код
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<String> list = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
            String a = reader.readLine();
            list.add(a);
        }
        for (int i = 1; i < 10; i++) {
            if (list.get(i).length() <= list.get(i + 1).length()) {
            } else {
                System.out.println(list.get(i+1).length());
                break;
            }
        }
    }
}