N=input() if len(N)>10: print(0) else: N = int(N) if N>=1000000008: print(0) else: print(N-1)