This page is still under construction.

Parts of this page are still being built. What you see may change.

Missing Number

Interview

Time limit1sMemory limit512 MB

Summary
A string lists the numbers 1 to n in order with one number erased; find the missing value.
Level

Easy2 of 10

Topics
String, Implementation, Brute force
Solved
No attempts yet

Problem

You are teaching kindergarten! You wrote down the numbers from 11 to nn, in order, on a whiteboard. While you were not paying attention, one of your students erased one of the numbers.

Can you tell which number your mischievous student erased?

Input

The first line of input contains a single integer nn (2≤n≤1002 \le n \le 100), which is the number of numbers that you wrote down.

The second line of input contains a string of digits, which represents the numbers you wrote down (minus the one that has been erased). There are no spaces in this string. It is guaranteed to contain all of the numbers from 11 to nn, in order, except for the single number that the student erased.

Output

Output a single integer, which is the number that the tricky student erased.

Examples3

  1. Example 1

    Input
    5
    1235
    
    Expected output
    4
    
  2. Example 2

    Input
    10
    1234568910
    
    Expected output
    7
    
  3. Example 3

    Input
    15
    1234567891012131415
    
    Expected output
    11