import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class _481 { public static void main(String[] args) throws IOException { new _481().solve(); } void solve() throws IOException { try (final Scanner in = new Scanner(System.in)) { for (int i = 1; i < 10; i++) { if (in.nextInt() != i) { System.out.println(i); return; } } System.out.println(10); } } // for debug static void dump(Object... o) { System.err.println(Arrays.deepToString(o)); } }