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