import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        for (int i = 0; i < x.length; i++) {
            x[i] = sc.nextInt();
        }

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

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

        for (int i = 0; i < x.length; i++) {
            if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        for (int i = 0; i < x.length; i++) {
            x[i] = sc.nextInt();
        }

        for (int i = 0; i < x.length; i++) {
            if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] x = new int[5]; x new int[5] 5 for (int i = 0; i < x.length; i++) {
            x[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < x.length i x.length x x.length i++ i++ i {
            x[i] = sc.nextInt();
        } {
            x[i] = sc.nextInt();
        } x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc for (int i = 0; i < x.length; i++) {
            if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            }
        } int i = 0; int i = 0; i 0 i < x.length i x.length x x.length i++ i++ i {
            if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            }
        } {
            if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            }
        } if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            } x[i] == 0 x[i] x i 0 {
                System.out.println(i + 1);
                break;
            } System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 break; String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        for (int i = 0; i < x.length; i++) {
            x[i] = sc.nextInt();
        }

        for (int i = 0; i < x.length; i++) {
            if (x[i] == 0) {
                System.out.println(i + 1);
                break;
            }
        }
    }
}
