import java.util.Scanner;

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

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