import java.util.*;

public class Main {

		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int result = 0;
	        int[] array = new int[5];
	        for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        }





	        System.out.println(result);
	}
} import java.util.*; util.* java public class Main {

		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int result = 0;
	        int[] array = new int[5];
	        for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        }





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

	        }





	        System.out.println(result);
	} main {
	        Scanner sc = new Scanner(System.in);
	        int result = 0;
	        int[] array = new int[5];
	        for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        }





	        System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int result = 0; result 0 int[] array = new int[5]; array new int[5] 5 for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        } int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        } {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc if(array[i]==0) result = i+1; array[i]==0 array[i] array i 0 result = i+1 result i+1 i 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int result = 0;
	        int[] array = new int[5];
	        for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        }





	        System.out.println(result);
	}
} public class Main {

		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int result = 0;
	        int[] array = new int[5];
	        for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        }





	        System.out.println(result);
	}
} Main
import java.util.*;

public class Main {

		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int result = 0;
	        int[] array = new int[5];
	        for(int i = 0; i<5; i++) {
	        	array[i] = sc.nextInt();
	            if(array[i]==0) result = i+1;

	        }





	        System.out.println(result);
	}
}
