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;
}
}
}
}
package com.codegym.task.task07.task0718;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Checking the order
*/
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;
}
}
}
}