import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] x = new int[10]; x new int[10] 10 for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		} int i = 1; int i = 1; i 1 i <= 5 i 5 ++i ++i i {
			x[i] = sc.nextInt();
		} {
			x[i] = sc.nextInt();
		} x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		} int i = 1; int i = 1; i 1 i <= 5 i 5 ++i ++i i {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		} {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		} if (x[i] == i) {
				continue;
			} x[i] == i x[i] x i i {
				continue;
			} continue; System.out.println(i) System.out.println System.out System System.out i return; String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int[] x = new int[10];
		for (int i = 1; i <= 5; ++i) {
			x[i] = sc.nextInt();
		}

		for (int i = 1; i <= 5; ++i) {
			if (x[i] == i) {
				continue;
			}

			System.out.println(i);
			return;
		}
	}

}
