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