// 制約侵害 check import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); if (!(1 <= N && N <= 1e12)) throw new AssertionError(); long ans = 0; for (long i = 1; i * i <= N; ++i) { if (N % i == 0) ans += (i + (i == N / i ? 0 : N / i)); } System.out.println(ans); } }