import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long sum = 0; for (long idx = 1; idx <= Math.sqrt(n); idx++) { if (n % idx == 0) { sum += idx; if (idx != n / idx) { sum += n / idx; } } } System.out.println(sum); } }