import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); long g; if (n % 2 == 0) { g = n / 2; } else { g = n; } long ans; if (g == 1) { ans = 1; } else { ans = g + 1; } for (long i = 2; i <= Math.sqrt(g); i++) { if (g % i == 0) { if (i * i == g) { ans += i; } else { ans += i; ans += g / i; } } } System.out.println(ans); } }