import java.util.Scanner; public class Main_yukicoder278_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); if (n == 1) { } else if (n % 2 == 1) { } else { n = n / 2; } if (n != 1) { long ret = 0; for (long j = 1; j * j <= n; j++) { if (n % j == 0) { ret += j; if (j != n / j) { ret += n / j; } } } System.out.println(ret); } else { System.out.println("1"); } sc.close(); } }