import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	} main {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] A = new int[5]; A new int[5] 5 for(int i=0; i<5; i++) {
			A[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int count = 1; count 1 for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		} int x A {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		} {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		} if(x==0) {
				System.out.print(count);
				break;
			} x==0 x 0 {
				System.out.print(count);
				break;
			} System.out.print(count) System.out.print System.out System System.out count break; count++ count String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] A = new int[5];

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

		int count = 1;
		for(int x : A) {
			if(x==0) {
				System.out.print(count);
				break;
			}
			count++;
		}
	}

}
