import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines D = int(read()) C = ''.join(map(str,range(1,100))) answer = C[D-1] print(answer)