import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	}
} Main public static void main(String[] args) {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	} main {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	} int[] N = new int[5]; N new int[5] 5 int result = 0; result 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		} int i =0; int i =0; i 0 i<5 i 5 i++ i++ i {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		} {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		} N[i]=scan.nextInt() N[i] N i scan.nextInt() scan.nextInt scan if(N[i]==0) {
				result = i+1;
			} N[i]==0 N[i] N i 0 {
				result = i+1;
			} result = i+1 result i+1 i 1 scan.close() scan.close scan 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) {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	}
} public class Main{
	public static void main(String[] args) {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		int[] N = new int[5];
		int result = 0;
		Scanner scan = new Scanner(System.in);
		for(int i =0;i<5;i++) {
			N[i]=scan.nextInt();
			if(N[i]==0) {
				result = i+1;
			}
		}		
		scan.close();
		System.out.println(result);
	}
}