import java.util.Scanner;

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

        int N = 5;

        for (int i = 0; i < N; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);

        int N = 5;

        for (int i = 0; i < N; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} Main public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);

        int N = 5;

        for (int i = 0; i < N; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    } main {
        Scanner scanner = new Scanner(System.in);

        int N = 5;

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

        int N = 5;

        for (int i = 0; i < N; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);

        int N = 5;

        for (int i = 0; i < N; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
} Main
import java.util.Scanner;

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

        int N = 5;

        for (int i = 0; i < N; i++) {
            int x = scanner.nextInt();
            if (x == 0) {
                System.out.println(i + 1);
                return;
            }
        }
    }
}
