d = int(input()) s = '0.' for i in range(1,56) : s += str(i) print(s[d+1])