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