import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    }
    return;
  }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    }
    return;
  }
} Main public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    }
    return;
  } main {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

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

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    } {
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    } int x; x x = sc.nextInt() x sc.nextInt() sc.nextInt sc if(x == 0){
        System.out.println(i+1);
        break;
      } x == 0 x 0 {
        System.out.println(i+1);
        break;
      } System.out.println(i+1) System.out.println System.out System System.out i+1 i 1 break; return; String[] args args public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    }
    return;
  }
} public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    }
    return;
  }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    for(int i=0; i<5; i++){
      int x;
      x = sc.nextInt();

      if(x == 0){
        System.out.println(i+1);
        break;
      }
    }
    return;
  }
}