Given an integer N. Consider the sequence S
1S
2S
3...S
k..., where each group of digits S
k consists of numbers written one after the other from 1 to k. For example, the first 75 digits of the sequence look like this:
112123123412345123456123456712345678123456789123456789101234567891011123456.
It is required to write a program that will determine which digit is in the Nth position in the constructed sequence.
Input
The input contains a single number N (0 < N < 32768).
Imprint
Print the number that is in the Nth position in the sequence.