import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int n = stdin.nextInt(); Set facts = new HashSet<>(); for (int fact = 1; fact * fact <= n; fact++) { if (n % fact != 0) continue; facts.add(fact); facts.add(n / fact); } int ans = facts.stream().mapToInt(Integer::intValue).sum(); System.out.println(ans); } }