// Arup Guha
// 3/6/2021
// Solution to 2020 SER Problem: Missing Number

import java.util.*;

public class missing {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		String s = stdin.next();
		s = s + (n+1);
		int idx = 0, res = -1;
		
		// Try each number.
		for (int i=1; i<=n; i++) {
			
			// # of digits we expect.
			int d = 1;
			if (i >= 10 && i < 100) d = 2;
			if (i == 100) d = 3;
			
			// Get this number.
			int cur = Integer.parseInt(s.substring(idx, idx+d));
			
			// We got it.
			if (i != cur) {
				res = i;
				break;
			}
			
			// Go to next.
			idx += d;
		}
		
		// Ta da!
		System.out.println(res);
	}
}