import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	}
} import java.util.*; util.* java import java.util.function.*; function.* java.util import java.math.*; math.* java public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	}
} Main public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	} main {
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int[] x = new int[5]; x new int[5] 5 int index = 0; index 0 for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		} {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		} x[i] = s.nextInt() x[i] x i s.nextInt() s.nextInt s if(x[i] == 0) {
				index = i + 1;
			} x[i] == 0 x[i] x i 0 {
				index = i + 1;
			} index = i + 1 index i + 1 i 1 System.out.println(index) System.out.println System.out System System.out index String[] args args public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	}
} public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	}
} Main
import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int[] x = new int[5];
		int index = 0;
		for(int i = 0; i < 5; i++) {
			x[i] = s.nextInt();
			if(x[i] == 0) {
				index = i + 1;
			}
		}
		System.out.println(index);
	}
}