import java.util.Scanner;

public class Main {
    public int getIdx(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) throws Exception {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public int getIdx(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) throws Exception {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    }
} Main public int getIdx(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    } getIdx {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    } for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
            if (arr[i] == 0) {
                return i + 1;
            }
        } {
            if (arr[i] == 0) {
                return i + 1;
            }
        } if (arr[i] == 0) {
                return i + 1;
            } arr[i] == 0 arr[i] arr i 0 {
                return i + 1;
            } return i + 1; i + 1 i 1 return -1; -1 1 int[] arr arr public static void main(String[] args) throws Exception {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    } main {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    } Main solution = new Main(); solution new Main() Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int first = scanner.nextInt(); first scanner.nextInt() scanner.nextInt scanner int second = scanner.nextInt(); second scanner.nextInt() scanner.nextInt scanner int third = scanner.nextInt(); third scanner.nextInt() scanner.nextInt scanner int fourth = scanner.nextInt(); fourth scanner.nextInt() scanner.nextInt scanner int fifth = scanner.nextInt(); fifth scanner.nextInt() scanner.nextInt scanner int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth }); answer solution.getIdx(new int[] { first, second, third, fourth, fifth }) solution.getIdx solution new int[] { first, second, third, fourth, fifth } System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public int getIdx(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) throws Exception {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    }
} public class Main {
    public int getIdx(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) throws Exception {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    }
} Main
import java.util.Scanner;

public class Main {
    public int getIdx(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == 0) {
                return i + 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) throws Exception {
        Main solution = new Main();

        Scanner scanner = new Scanner(System.in);
        int first = scanner.nextInt();
        int second = scanner.nextInt();
        int third = scanner.nextInt();
        int fourth = scanner.nextInt();
        int fifth = scanner.nextInt();

        int answer = solution.getIdx(new int[] { first, second, third, fourth, fifth });
        System.out.println(answer);
    }
}
