import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner n = new Scanner(System.in) ;

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

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

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

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

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

		for(int i=0;i<5;i++) {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		}
	} main {
		Scanner n = new Scanner(System.in) ;

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

		for(int i=0;i<5;i++) {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		}
	} Scanner n = new Scanner(System.in) ; n new Scanner(System.in) int[] xList = new int[5]; xList new int[5] 5 for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			int x = n.nextInt();
			xList[i] = x;
		} {
			int x = n.nextInt();
			xList[i] = x;
		} int x = n.nextInt(); x n.nextInt() n.nextInt n xList[i] = x xList[i] xList i x for(int i=0;i<5;i++) {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		} {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		} if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			} xList[i] == 0 xList[i] xList i 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 n = new Scanner(System.in) ;

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

		for(int i=0;i<5;i++) {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner n = new Scanner(System.in) ;

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

		for(int i=0;i<5;i++) {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner n = new Scanner(System.in) ;

		int[] xList = new int[5];

		for(int i=0;i<5;i++) {
			int x = n.nextInt();
			xList[i] = x;
		}

		for(int i=0;i<5;i++) {
			if(xList[i] == 0) {
				System.out.println(i+1);
				break;
			}
		}
	}
}
