import sys import math N=int(input()) if N>=1000000008: print(0) else: print(N-1)