n = int(input()) # s = '-7xxx5xxxx0' # 1,4,5 s = '-72225????0' print(s[n])