import java.util.*;

public class Main{
	public static void main(String args[]){
		
		Scanner ob = new Scanner(System.in);
		int[] nums = new int[5];
		int C = 0;

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

		System.out.println(C);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		
		Scanner ob = new Scanner(System.in);
		int[] nums = new int[5];
		int C = 0;

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

		System.out.println(C);
	}
} Main public static void main(String args[]){
		
		Scanner ob = new Scanner(System.in);
		int[] nums = new int[5];
		int C = 0;

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

		System.out.println(C);
	} main {
		
		Scanner ob = new Scanner(System.in);
		int[] nums = new int[5];
		int C = 0;

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

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

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

		System.out.println(C);
	}
} public class Main{
	public static void main(String args[]){
		
		Scanner ob = new Scanner(System.in);
		int[] nums = new int[5];
		int C = 0;

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

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

public class Main{
	public static void main(String args[]){
		
		Scanner ob = new Scanner(System.in);
		int[] nums = new int[5];
		int C = 0;

		for(int i = 0; i < 5; i++){
			nums[i] = ob.nextInt();
		}

		for(int j = 0; j < 5; j++){
			if(nums[j] == 0){
				C = j + 1;
				break;
			}
		}

		System.out.println(C);
	}
}
