n = int(input()) if n == 1: print("7") elif n == 4: print("6") elif n == 5: print("5") else: print("4")