D = int(input()) C = "0." for i in range(60): C += str(i) print(C[D+2])