import sys sys.setrecursionlimit(10 ** 6) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LC(): return list(input()) def IC(): return [int(c) for c in input()] def MI(): return map(int, sys.stdin.readline().split()) INF = float('inf') def solve(): N = II() if(N==2): print(2) elif(N%2 == 1): print(1) else: print(N//2+1) return solve()