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