import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] X = new int[5]; X new int[5] 5 int result = 0; result 0 for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        } {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        } X[i] = scanner.nextInt() X[i] X i scanner.nextInt() scanner.nextInt scanner if (X[i] == 0) {
                result = i+1;
            } X[i] == 0 X[i] X i 0 {
                result = i+1;
            } result = i+1 result i+1 i 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] X = new int[5];
        int result = 0;

        for (int i = 0; i < 5; i++) {
            X[i] = scanner.nextInt();
            if (X[i] == 0) {
                result = i+1;
            }
        }

        System.out.println(result);
    }
}
