import scala.annotation.tailrec import scala.io.StdIn.* def primeFactors(value: Int): List[Int] = def inner(v: Int, p: Int): List[Int] = v match case 1 => Nil case _ if p * p > v => v::Nil case _ if v % p == 0 => p::inner(v / p, p) case _ => inner(v, p + 1) inner(value, 2) @main def main = val n = readLine().toInt val factor = primeFactors(n) println(factor.sum)