public class Solution { public static void main(String[] args) throws IOException { //write your code here ArrayList<String> strings = new ArrayList<String>(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); for (int i = 0; i < 10; i++) { strings.add(reader.readLine()); } for (int i = 0; i < strings.size(); i++) { if (strings.get(i).length() < strings.get(i+1).length()) { i++; } else { System.out.println(i); break; } } } }