package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Long value = scanner.nextLong(); if(value % 2 == 0) { value /=2; } double root = Math.sqrt((double) value); Long sum = 0L; for(Long i = 1L; i <= root;i++) { if(value % i == 0) { Long other = value / i; if(i == other) { sum += i; } else { sum += i + other; } } } System.out.println(sum.toString()); } }