import sys input=lambda: sys.stdin.readline().rstrip() d=int(input()) C="" for i in range(1,100): C+=str(i) print(C[d-1])