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; } Long sum = 0L; for(Long i = 1L; i * i <= value;i++) { if(value % i == 0) { Long other = value / i; sum += i; if(i < other) { sum += other; } } } System.out.println(sum.toString()); } }