import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			list.add(Integer.parseInt(sc.next()));
		} {
			list.add(Integer.parseInt(sc.next()));
		} list.add(Integer.parseInt(sc.next())) list.add list Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		} {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		} if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			} list.get(i) == 0 list.get(i) list.get list i 0 {
				int ans = i + 1;
				System.out.println(ans);
				return;
			} int ans = i + 1; ans i + 1 i 1 System.out.println(ans) System.out.println System.out System System.out ans return; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		for(int i = 0; i < 5; i++) {
			list.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		for(int i = 0; i < 5; i++) {
			if(list.get(i) == 0) {
				int ans = i + 1;
				System.out.println(ans);
				return;
			}
		}
	}

}