Alien

All submissions for this problem are available.
Problem
The intelligent alien from Complrotr planet decided to have a day off and he decided to play a game with pebbles. Initially, the alien has n pebbles. He arranges them in a equal rows, each row has b pebbles (a > 1). Note that the alien must use all the pebbles he has, i. e. n = a·b.
10 pebbles are arranged in two rows, each row has 5 pebbles
Once the intelligent alien has arranged the pebbles, he takes back any of the resulting rows (that is, b pebbles) and discards all other pebbles. Then he arranges all his pebbles again (possibly choosing other values of a and b) and takes back one row, and so on. The game continues until at some point the alien ends up with exactly one pebble.
The game process can be represented as a finite sequence of integers c1, ..., ck, where:
c1 = n
ci + 1 is the number of pebbles that the alien ends up with after the ith move, that is, the number of pebbles in a row after some arrangement of ci pebbles (1 ≤ i < k). Note that ci > ci + 1.
ck = 1
The result of the game is the sum of numbers ci. You are given n. Find the maximum possible result of the game.
Input
The single line of the input contains a single integer n — the initial number of pebbles the intelligent alien has.
Input
The single line of the input contains a single integer n — the initial number of pebbles the intelligent alien has.
Output
Print a single number  the maximum possible result of the game.
Constraints
The input limitations
2 ≤ n ≤ 109
Example
Input: 123456789 Output: 178330277
Author:  naveenrajan 
Tags  naveenrajan 
Date Added:  20022015 
Time Limit:  5 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 