import sys

for line in sys.stdin:
    a = int(line.strip())
    if a == 7:
        print(1)
    else:
        print(a+1)