N=int(input()) if N%2==0: x=N//2 else: x=N # xの約数の列挙 import math xr=math.ceil(math.sqrt(x)) LIST=[] for i in range(1,xr+1): if x%i==0: LIST.append(i) LIST.append(x//i) ANS=0 for s in set(LIST): ANS+=s print(ANS)