import java.util.Scanner;

public class Main {

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

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

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

public class Main {

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