O='' for i in range(55):O+=str(i+1) print(O[int(input())-1])