public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<String> list = new ArrayList<>();
        for(int i=0;i<10;i++){
            list.add(reader.readLine());
        }

        for(int i =0; i< list.size();i++) {
            if (list.get(i).length() < list.get(i + 1).length()) {
                i++;
            } else if (list.get(i).length() > list.get(i + 1).length()) {
                System.out.println(i + 1);
                break;
            }

        }

    }
}