Factor Fusion


Given an integer nn, return the sum of all of its unique factors.

Input

Your first line will contain an integer nn.

Output

The sum of all unique factors of nn.

Constraints

For all test cases:

  • 1≤n≤1071 \le n \le 10^7

Example 1

Input 1
10
Output 1
18
Explanation

The factors of 1010 are 1,2,5,101, 2, 5, 10. The sum of these factors is 1818.

Example 2

Input 2
4
Output 2
7
Explanation

The factors of 44 are 1,2,41, 2, 4. The sum of these factors is 77.

Python Template

Code 1
n = int(input())

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.