import java.util.*;

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

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

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

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

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

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

    for (int j=0;j<5;j++){
      if (a[j] == 0){
        System.out.println(j+1);
        return;
      }
    }
  }
} Main
import java.util.*;

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

    for (int j=0;j<5;j++){
      if (a[j] == 0){
        System.out.println(j+1);
        return;
      }
    }
  }
}
