import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int sin[] = new int[5];
		int good = 0;
		
	
		for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		}
		
		System.out.println(good + 1);
		
	}
		
	
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int sin[] = new int[5];
		int good = 0;
		
	
		for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		}
		
		System.out.println(good + 1);
		
	}
		
	
} Main public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int sin[] = new int[5];
		int good = 0;
		
	
		for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		}
		
		System.out.println(good + 1);
		
	} main {
		Scanner scan = new Scanner(System.in);
		int sin[] = new int[5];
		int good = 0;
		
	
		for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		}
		
		System.out.println(good + 1);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int sin[] = new int[5]; sin new int[5] 5 int good = 0; good 0 for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		} {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		} sin[i] = scan.nextInt() sin[i] sin i scan.nextInt() scan.nextInt scan if(sin[i] == 0) {
				good = i;
				break;
				
			} sin[i] == 0 sin[i] sin i 0 {
				good = i;
				break;
				
			} good = i good i break; System.out.println(good + 1) System.out.println System.out System System.out good + 1 good 1 String args[] args public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int sin[] = new int[5];
		int good = 0;
		
	
		for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		}
		
		System.out.println(good + 1);
		
	}
		
	
} public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int sin[] = new int[5];
		int good = 0;
		
	
		for(int i = 0; i < 5; i++) {
			sin[i] = scan.nextInt();
			if(sin[i] == 0) {
				good = i;
				break;
				
			}
			
		}
		
		System.out.println(good + 1);
		
	}
		
	
} Main
import java.util.Scanner;

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

