import java.io.*;
import java.math.BigInteger;
import java.util.*;

import sun.security.util.BigInt;

public class bigsum_ats implements Runnable {
  public static void main(String[] args) {
    new Thread(new bigsum_ats()).start();
  }

  BufferedReader br;
  PrintWriter out;
  StringTokenizer in;

  public String nextToken() throws IOException {
    while (in == null || !in.hasMoreTokens()) {
      in = new StringTokenizer(br.readLine());
    }
    return in.nextToken();
  }

  public int nextInt() throws IOException {
    return Integer.parseInt(nextToken());
  }

  public long nextLong() throws IOException {
    return Long.parseLong(nextToken());
  }

  public double nextDouble() throws IOException {
    return Double.parseDouble(nextToken());
  }

  TreeMap<Long, BigInteger> g;

  public void calc(long val) {
    if (val == 1) {
      g.put((long) 1, BigInteger.ONE);
      return;
    }
    if (BigInteger.valueOf(val).isProbablePrime(10)) {
      g.put(val, BigInteger.valueOf(val * 2 - 1));
      return;
    }
    for (long i = 2; i <= Math.sqrt(val); i++) {
      if (val % i == 0) {
        long d = 1;
        long tval = val;
        while (tval % i == 0) {
          d *= i;
          tval /= i;
        }
        if (tval == 1) {
          int alpha = 0;
          while (tval < d) {
            tval *= i;
            alpha++;
          }
          BigInteger func = BigInteger.valueOf(alpha
              * (tval - tval / i) + tval);
          g.put(val, func);
        } else {
          g.put(val, g.get(d).multiply(g.get(tval)));
        }
        return;
      }
    }
  }

  public void solve() throws IOException {
    long n = nextLong();
    assert(1 <= n && n <= (long)1e12);
    g = new TreeMap<Long, BigInteger>();
    for (long i = 1; i <= (long) Math.sqrt(n); i++) {
      if (n % i == 0) {
        calc(i);
      }
    }
    for (long i = (long) Math.sqrt(n); i >= 1; i--) {
      if (n % i == 0 && i * i != n) {
        calc(n / i);
      }
    }
    BigInteger ans = BigInteger.ZERO;
    for (long i = 1; i <= (long) Math.sqrt(n); i++) {
      if (n % i == 0) {
        ans = ans.add(g.get(i).multiply(BigInteger.valueOf(n / i)));
        if (n / i != i)
          ans = ans.add(g.get(n / i).multiply(BigInteger.valueOf(i)));
      }
    }
    out.println(ans);
  }

  public void run() {
    Locale.setDefault(Locale.US);
    try {
      br = new BufferedReader(new FileReader("bigsum.in"));
      out = new PrintWriter("bigsum.out");

      solve();

      out.close();
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }

  }
}
