import sys d = int(input()) a = [1,2,3,4,5,6,7] c = 0 for i in a: if i == d & i !=7: c = i+1 if d == 7: c = 1 print(c)