C_10 = str("") for i in range(91): C_10 = C_10 + str(i) D = int(input()) print(C_10[D])