import java.util.Scanner;

public class Main {

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

	}

} import java.util.Scanner; Scanner java.util public class Main {

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

	}

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

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

	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int[] ara = new int[5]; ara new int[5] 5 for(int i = 0;i<ara.length;i++) {
			ara[i] = in.nextInt();
			
			if(ara[i] == 0) {
				System.out.println((i+1));
				break;
			}
		} int i = 0; int i = 0; i 0 i<ara.length i ara.length ara ara.length i++ i++ i {
			ara[i] = in.nextInt();
			
			if(ara[i] == 0) {
				System.out.println((i+1));
				break;
			}
		} {
			ara[i] = in.nextInt();
			
			if(ara[i] == 0) {
				System.out.println((i+1));
				break;
			}
		} ara[i] = in.nextInt() ara[i] ara i in.nextInt() in.nextInt in if(ara[i] == 0) {
				System.out.println((i+1));
				break;
			} ara[i] == 0 ara[i] ara 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; String[] args args public class Main {

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

	}

} public class Main {

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

	}

} Main
import java.util.Scanner;

public class Main {

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

	}

}
