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