import java.util.Scanner;
import java.util.ArrayList;
 
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    }
  
  public static void check(int[] num){
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    }
  
  public static void check(int[] num){
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() int x_1 x_1 x_2 x_2 x_3 x_3 x_4 x_4 x_5; x_5 int i = 0; i 0 String an = scan.nextLine(); an scan.nextLine() scan.nextLine scan String atai[] = an.split(" ",0); atai an.split(" ",0) an.split an " " 0 int num[] = new int[5]; num new int[5] 5 while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      } i < 5 i 5 {
        num[i] = Integer.parseInt(atai[i]);
        i++;
      } num[i] = Integer.parseInt(atai[i]) num[i] num i Integer.parseInt(atai[i]) Integer.parseInt Integer atai[i] atai i i++ i x_1 = num[0] x_1 num[0] num 0 x_2 = num[1] x_2 num[1] num 1 x_3 = num[2] x_3 num[2] num 2 x_4 = num[3] x_4 num[3] num 3 x_5 = num[4] x_5 num[4] num 4 check(num) check num scan.close() scan.close scan String[] args args public static void check(int[] num){
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  } check {
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  } int i = 0; i 0 while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    } i<5 i 5 {
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    } if(num[i] == 0){
        System.out.println(i+1);
        break;
      } num[i] == 0 num[i] num i 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; i++ i return; int[] num num public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    }
  
  public static void check(int[] num){
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    }
  
  public static void check(int[] num){
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  }
} Main
import java.util.Scanner;
import java.util.ArrayList;
 
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
      ArrayList<String> list = new ArrayList<String>();
      int x_1,x_2,x_3,x_4,x_5;
      int i = 0;
      String an = scan.nextLine();
      String atai[] = an.split(" ",0);
      int num[] = new int[5];
      while(i < 5){
        num[i] = Integer.parseInt(atai[i]);
        i++;
      }
      x_1 = num[0];
      x_2 = num[1];
      x_3 = num[2];
      x_4 = num[3];
      x_5 = num[4];
//      System.out.println(A+","+B+","+H+","+M);
      check(num);
        scan.close();
    }
  
  public static void check(int[] num){
   //System.out.println(num[0]);
    int i = 0;
    while(i<5){
      if(num[i] == 0){
        System.out.println(i+1);
        break;
      }
      i++;
    }
    return;
  }
}