n = int(input()) m = int(n * (n + 1) / 2) ret = i = 1 while i * i <= n: i += 1 cnt = 1 while n % i == 0 and m % i == 0: cnt += 1 n /= i m /= i ret *= (i**ret - 1) / (i - 1) ret *= n + 1 if n > 1 else 1 print(int(ret))