def factorization(n): arr = [1] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append(i) if temp!=1: arr.append(temp) if arr==[]: arr.append(n) arr.append(n) return arr n = int(input()) factor = factorization(n) print(sum(factor))