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

// ABC170-A
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> x = new ArrayList<>(); x new ArrayList<>() for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			x.add(sc.nextInt());
		} {
			x.add(sc.nextInt());
		} x.add(sc.nextInt()) x.add x sc.nextInt() sc.nextInt sc for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		} Integer i x {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		} {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		} if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			} i == 0 i 0 {
				System.out.println(x.indexOf(i) + 1);
			} System.out.println(x.indexOf(i) + 1) System.out.println System.out System System.out x.indexOf(i) + 1 x.indexOf(i) x.indexOf x i 1 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

// ABC170-A
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> x = new ArrayList<>();

		for (int i = 0; i < 5; i++) {
			x.add(sc.nextInt());
		}

		for (Integer i : x) {
			if (i == 0) {
				System.out.println(x.indexOf(i) + 1);
			}
		}

		sc.close();
	}
}
