D = int(input()) C = "" for i in range(1, 100): C += str(i) print(C[D-1])