import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) INF = 2**63-1 mod = 998244353 from collections import Counter n = ii() def euler_phi(n): res = n x = 2 while x*x <= n: if n % x == 0: res = res // x * (x-1) while n % x == 0: n //= x x += 1 if n > 1: res = res // n * (n-1) return res ans = n * euler_phi(n) if ans > 1000: print("1000+") else: print(ans)