import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	} main {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int solution = 0; solution 0 int i = 0; i 0 while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		} scanner.hasNext() scanner.hasNext scanner {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		} if(scanner.nextInt() == 0)
				solution = i + 1; scanner.nextInt() == 0 scanner.nextInt() scanner.nextInt scanner 0 solution = i + 1 solution i + 1 i 1 i++ i System.out.print(solution) System.out.print System.out System System.out solution String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int solution = 0;
		int i = 0;
		while(scanner.hasNext()) {
			if(scanner.nextInt() == 0)
				solution = i + 1;
			i++;
		}
		System.out.print(solution);
		
	}
}
