import java.util.*;

public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	}

} Main public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	} main {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x[] = new int[6]; x new int[6] 6 x[1] = Integer.parseInt(sc.next()) x[1] x 1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc x[2] = Integer.parseInt(sc.next()) x[2] x 2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc x[3] = Integer.parseInt(sc.next()) x[3] x 3 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc x[4] = Integer.parseInt(sc.next()) x[4] x 4 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc x[5] = Integer.parseInt(sc.next()) x[5] x 5 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		} int i = 1; int i = 1; i 1 i <= 5 i 5 i++ i++ i {
			if (x[i] == 0) {
				System.out.println(i);
			}
		} {
			if (x[i] == 0) {
				System.out.println(i);
			}
		} if (x[i] == 0) {
				System.out.println(i);
			} x[i] == 0 x[i] x i 0 {
				System.out.println(i);
			} System.out.println(i) System.out.println System.out System System.out i String[] args args public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	}

} public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int x[] = new int[6];
		x[1] = Integer.parseInt(sc.next());
		x[2] = Integer.parseInt(sc.next());
		x[3] = Integer.parseInt(sc.next());
		x[4] = Integer.parseInt(sc.next());
		x[5] = Integer.parseInt(sc.next());

		// 0になっているのを見つける
		for (int i = 1; i <= 5; i++) {
			if (x[i] == 0) {
				System.out.println(i);
			}
		}
	}

}