human
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.

Input

The only line of the input contains a single integer n (1 ≤ n ≤ 1000) — the position of the digit you need to print.

Output

Print the n-th digit of the line.

Examples

Input

3

Output

3

Input

11

Output

0

Note

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.
Using python3 can you solve the prior task?
 What is a Python code to fix of these line is "123456789101112131415?
assistant
#Here is Python code to fix of these line is "123456789101112131415.

#!/usr/bin/env python3
# 672A_camp.py - Codeforces.com/problemset/problem/672/A by Sergey 2016

import unittest
import sys

###############################################################################
# Camp Class (Main Program)
###############################################################################

class Camp:
    """ Camp representation """

    def __init__(self, test_inputs=None):
        """ Default constructor """

        it = iter(test_inputs.split("\n")) if test_inputs else None

        def uinput():
            return next(it) if it else sys.stdin.readline().rstrip()

        # Reading single elements
        [self.n] = map(int, uinput().split())

    def calculate(self):
        """ Main calcualtion function of the class """

        line = ""
        for i in range(400):
            line += str(i)

        result = line[self.n]

        return str(result)

###############################################################################
# Unit Tests
###############################################################################

class unitTests(unittest.TestCase):

    def test_single_test(self):
        """ Camp class testing """

        # Constructor test
        test = "3"
        d = Camp(test)
        self.assertEqual(d.n, 3)

        # Sample test
        self.assertEqual(Camp(test).calculate(), "3")

        # Sample test
        test = "11"
        self.assertEqual(Camp(test).calculate(), "0")

        # Sample test
        test = ""
        # self.assertEqual(Camp(test).calculate(), "0")

        # My tests
        test = ""
        # self.assertEqual(Camp(test).calculate(), "0")

        # Time limit test
        # self.time_limit_test(5000)

    def time_limit_test(self, nmax):
        """ Timelimit testing """
        import random
        import timeit

        # Random inputs
        test = str(nmax) + " " + str(nmax) + "\n"
        numnums = [str(i) + " " + str(i+1) for i in range(nmax)]
        test += "\n".join(numnums) + "\n"
        nums = [random.randint(1, 10000)...