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