import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	}

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

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	}

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

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	} main {

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int[] nums = new int[5]; nums new int[5] 5 int index = 0; index 0 for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		} index = 0 ; index = 0 index 0 index < 5 index 5 index++ index++ index {

			nums[index] = s.nextInt();
		} {

			nums[index] = s.nextInt();
		} nums[index] = s.nextInt() nums[index] nums index s.nextInt() s.nextInt s for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		} index = 0 ; index = 0 index 0 index < 5 index 5 index++ index++ index {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		} {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		} if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			} nums[index] == 0 nums[index] nums index 0 {
				System.out.println(index+1);
				break;
			} System.out.println(index+1) System.out.println System.out System System.out index+1 index 1 break; String[] args args public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	}

} public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] nums = new int[5];

		int index = 0;

		for(index = 0 ; index < 5 ; index++) {

			nums[index] = s.nextInt();
		}

		for(index = 0 ; index < 5 ; index++) {

			if(nums[index] == 0) {
				System.out.println(index+1);
				break;
			}
		}

	}

}
