import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	} main {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int[] arr = new int[5]; arr new int[5] 5 for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			arr[i] = scn.nextInt();
		} {
			arr[i] = scn.nextInt();
		} arr[i] = scn.nextInt() arr[i] arr i scn.nextInt() scn.nextInt scn for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		} {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		} int a = arr[i]; a arr[i] arr i if (a == 0) {
				System.out.println(i + 1);
			} a == 0 a 0 {
				System.out.println(i + 1);
			} System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 String[] args args public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int[] arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = scn.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			int a = arr[i];
			if (a == 0) {
				System.out.println(i + 1);
			}
		}
	}
}