import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        }; xs {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        } -1 1 sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        } int i = 1; int i = 1; i 1 i < xs.length i xs.length xs xs.length i++ i++ i {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        } {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        } if (xs[i] == 0) {
                System.out.println(i);
                break;
            } xs[i] == 0 xs[i] xs i 0 {
                System.out.println(i);
                break;
            } System.out.println(i) System.out.println System.out System System.out i break; String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] xs = {
                -1,
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt(),
                sc.nextInt()
        };
        for (int i = 1; i < xs.length; i++) {
            if (xs[i] == 0) {
                System.out.println(i);
                break;
            }
        }
    }
}