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());
        }
            int n = 0;
            for (int i = 0; i < list.size() - 1; i++){
                if (list.get(i).length() < list.get(i + 1).length()){
                    n++;
                }
                else {
                    n = n + 1;
                    break;
                }
            }

        if (n + 1 < list.size()) {
            System.out.println(n);
        }
    }
}