import java.util.Scanner;

public class Main {

	private static final int N = 5;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	private static final int N = 5;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	}
} Main private static final int N = 5; N 5 public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		} {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int result = 0; result 0 for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			} {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			} int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner if (0 == a) {
					result = i;
				} 0 == a 0 a {
					result = i;
				} result = i result i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	private static final int N = 5;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	}
} public class Main {

	private static final int N = 5;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	private static final int N = 5;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int result = 0;
			for (int i = 1; i <= N; i++) {
				int a = scanner.nextInt();
				if (0 == a) {
					result = i;
				}
			}
			System.out.println(result);
		}
	}
}
