#!/usr/bin/env python3

from pprint import pprint
from sys import setrecursionlimit, stdin
from typing import Dict, Iterable, Set

INF: int = 1 << 62
MOD1000000007 = 10**9 + 7
MOD998244353 = 998244353
setrecursionlimit(1_000_000)


def inputs(type_=int):
    ins = input().split()

    if isinstance(type_, Iterable):
        return [t(x) for t, x in zip(type_, ins)]
    else:
        return list(map(type_, ins))


def input_(type_=int):
    a, = inputs(type_)
    return a


def input1() -> int:
    return int(input())
inputi = input1


def input2():
    a, b = input().split()
    return int(a), int(b)


def input3():
    a, b, c = input().split()
    return int(a), int(b), int(c)


def input4():
    a, b, c, d = input().split()
    return int(a), int(b), int(c), int(d)


def answer(res) -> None:
    print(res)
    exit()


# start coding

def get_one_factor(n: int, start: int = 2) -> int:
    """
    一つの素因数を計算する
    計算量は O(sqrt(n))
    """
    i = start
    while i * i <= n:
        if n % i == 0:
            return i
        i += 1

    return n


def compute_factors(n: int):
    """
    素因数分解を計算する
    計算量は O(sqrt(n)log(n))
    """
    assert n >= 1

    if n == 1:
        return {}

    d = {}
    start = 2
    while n > 1:
        k = get_one_factor(n, start)
        start = k
        count = 0
        while n % k == 0:
            n //= k
            count += 1

        d[k] = count

    return d

n = inputi()
res = 0
for f, cnt in compute_factors(n).items():
    res += f * cnt

print(res)