import java.util.Scanner;

public class Main {
	public static int print(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static int print(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	}

} Main public static int print(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	} print {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	} for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			if (arr[i] == 0) {
				return i+1;
			}
		} {
			if (arr[i] == 0) {
				return i+1;
			}
		} if (arr[i] == 0) {
				return i+1;
			} arr[i] == 0 arr[i] arr i 0 {
				return i+1;
			} return i+1; i+1 i 1 return 0; 0 int[] arr arr public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	} main {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int[] arr = new int[5]; arr new int[5] 5 for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			arr[i] = s.nextInt();
		} {
			arr[i] = s.nextInt();
		} arr[i] = s.nextInt() arr[i] arr i s.nextInt() s.nextInt s int result = print(arr); result print(arr) print arr System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static int print(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	}

} public class Main {
	public static int print(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	}

} Main
import java.util.Scanner;

public class Main {
	public static int print(int[] arr) {

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == 0) {
				return i+1;
			}
		}
		return 0;
	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int[] arr = new int[5];

		for (int i = 0; i < arr.length; i++) {
			arr[i] = s.nextInt();
		}

		int result = print(arr);
		System.out.println(result);

	}

}
