import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   } main {
        Scanner sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] n = new int[5]; n new int[5] 5 for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        } {
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        } n[i] = sc.nextInt() n[i] n i sc.nextInt() sc.nextInt sc if(n[i]==0){
                System.out.println(i+1);
                return;
            } n[i]==0 n[i] n i 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 sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int[] n = new int[5];
        
        for(int i=0; i<5; i++){
            n[i] = sc.nextInt();
            if(n[i]==0){
                System.out.println(i+1);
                return;
            }
        }
        
        
   }
}
