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