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