// Задача ""
// 1-ая Интернет-олимпиада сезона 2007-2008, базовый уровень
// Автор задачи: 
// Автор решения: Сергей Поромов, poromov@mail.ru 

import java.io.*;
import java.util.*;

public class divsum2_sp implements Runnable {

	public static void main(String[] args) {
		new Thread(new divsum2_sp()).run();
	}

	public void run() {
		try {
			solve();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	BufferedReader br;

	PrintWriter out;

	StringTokenizer st;

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

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

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

	private static final String FILENAME = "divsum2";
	
	void myassert(boolean e, String s) {
		if (!e) {
			throw new Error("Assertion failure " + s);
		}
	}

	public void solve() throws IOException {
		br = new BufferedReader(new FileReader(FILENAME + ".in"));
		out = new PrintWriter(FILENAME + ".out");
		long n = nextLong();
		myassert(n >= 1 && n <= 1e18, "Constant not in range");
		long ans = 1;
		for (int i = 2; i < 1000; i++) {
			long t = i;
			while (n % i == 0) {
				n /= i;
				t *= i;
			}
			if (t != i) {
				ans *= (t - 1) / (i - 1) - 1;
			}
		}
		myassert(n == 1, "Prime divider is big - " + n);
		out.println(ans);
		out.close();
	}
}
