# 读取输入的今天星期几
d = int(input())

# 计算明天的星期数:若今天是星期日(7),则明天是1;否则明天是d+1
tomorrow = 1 if d == 7 else d + 1

# 输出结果
print(tomorrow)