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

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

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

}