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