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