n = int(input())

S = " "

for i in range(n):
    S = S + str(i+1)

print(S[n])