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