Every year, hundreds of people come to summer camps, they learn new algorithms and solve hard problems.

This is your first year at summer camp, and you are asked to solve the following problem. All integers starting with 1 are written in one line. The prefix of these line is "123456789101112131415...". Your task is to print the *n*-th digit of this string (digits are numbered starting with 1.
The only line of the input contains a single integer *n* (1 ≤ *n* ≤ 1000) — the position of the digit you need to print.
In the first sample the digit at position 3 is '3', as both integers 1 and 2 consist on one digit.

In the second sample, the digit at position 11 is '0', it belongs to the integer 10.
3
3
11
0
12
1
13
1
29
9
30
2
1000
3
999
9
100
5
123
6
8
8
157
3
289
1
179
4
942
0
879
9
394
1
423
7
952
3
121
5
613
2
945
1
270
6
781
2
453
7
171
0
643
2
570
6
750
6
500
0
2
2
1
1
108
5
500
0
189
9
491
0
191
0
# input the desired index
n = int(input())
# you can solve this problem in many ways
# you can brute force it by writing the 1000 char of the prefix with a pen
# you can figure out the pattern and describe it 
# you can generate the 1000 digits and then just index the string
# and this is the easiest of them all
# of course, it is not efficent and it is problem specific

# first create and empty string
prefix=""
# loop for example until 1000
for i in range(1,1000):
    # check if number starts with 1
    if str(i).startswith('1'):
        # add it to prefix
        prefix+=str(i)
    # check if we exceeded the 1000 char of the pattern.
    if len(prefix)>=1000:
        break
# simply index it but prefix's first index starts from 0. So, minus one to get the correct index
print(prefix[n-1])