n = int(input()) # s = '-7xxx5xxxx0' # 1,4,5 # s = '-7xxx5xx2?0' # 1,4,5,8 # s = '-7xxx5xx230' # 1,4,5,8,9 s = '-7x4?5xx230' print(s[n])