public class Solution {
    public static void main(String[] args) throws IOException {
        ArrayList<String> arr = new ArrayList<String>();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> rising = new ArrayList<Integer>();
        ArrayList<Integer> real = new ArrayList<Integer>();
        for (int i = 0; i < 10; i++) {
            String a = br.readLine();
            arr.add(a);
        }
        for (String s : arr) {
            rising.add(s.length());
            real.add(s.length());
        }
        Collections.sort(rising);
        for (int i = 0; i < rising.size(); i++) {
            if (!rising.get(i).equals(real.get(i))) {
                System.out.println(i);
                break;
            }
        }
    }
}