/import java.io.BufferedReader; import java.io.IOException; //import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Scanner; //import java.util.*; /* Checking the order */ public class Solution { public static void main(String[] args) throws IOException { Scanner sc = new Scanner (System.in); ArrayList<String> list = new ArrayList<String>(); int index = 0; for (int i = 0; i < 10; i++) { String s = sc.nextLine(); if (s.isEmpty()) break; list.add(s); } for (int i = 0; i < list.size() - 1; i++){ if (list.get(i).length()>list.get(i+1).length()){ index = i; break; } } if (index != 0){ System.out.println(index); } } }