import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> al = new ArrayList<>(); al new ArrayList<>() for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		} int p =0; int p =0; p 0 p<5 p 5 p++ p++ p {
			int num = sc.nextInt();
			al.add(num);
		} {
			int num = sc.nextInt();
			al.add(num);
		} int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc al.add(num) al.add al num for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		} int p=0; int p=0; p 0 p<al.size() p al.size() al.size al p++ p++ p {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		} {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		} if(al.get(p)==0) {
				System.out.println(p + 1);
			} al.get(p)==0 al.get(p) al.get al p 0 {
				System.out.println(p + 1);
			} System.out.println(p + 1) System.out.println System.out System System.out p + 1 p 1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> al = new ArrayList<>();
		for(int p =0; p<5; p++) {
			int num = sc.nextInt();
			al.add(num);
		}
		for(int p=0; p<al.size(); p++) {
			if(al.get(p)==0) {
				System.out.println(p + 1);
			}
		}
	}
}
