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++) { list.add(reader.readLine()); } for(int j = 0; j < list.size(); ){ if (list.get(j).length() <= list.get(j+1).length()){ j++; } else break; System.out.println(j+1); } } }