// i == N/i の処理が抜けている場合 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 + N / i; } System.out.println(ans); } }