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

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

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

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

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

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

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

      
     
    }
   
    
       
    
}