28237
 13190
 39914
 81367
 8554
 61106
 67448
 39004
 22308
 16054
 71468
 60501
 100
 300
 59632
 90783
 5611
 1000
 69475
 69753
 10
 5
 582
 8
 36961
 5071
 20
 53213
 92775
 28738
 100000
 92280
 37944
 9
 2627
 7
 3

1028306548 224346172 2054738392 8539207488 94344524 4816051228 5867563092 1962150044 641839188 332342852 6587875268 4721174212 12600 115440 4586497300 10630118936 40580456 1286328 6225539588 6275533596 92 8 434692 52 1762017168 33141852 440 3652070664 11101694484 1065137992 12898363344 10983871880 1856988304 64 8885348 28 0
import java.util.Scanner;

public class Main {
	static boolean prime[] = new boolean[100000 + 1];
	static int primes[] = new int[1000];

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = sieveOfEratosthenes(n + 1);
		long ans = 0;
		int current = n;
		int prevP = -1;
		int n1 = n;

		if (n == 2 || n == 3) {
			System.out.println(0);
		} else {
			while (prime[n]) {
				n--;
			}
			int currentn = n;
			int prevX = 1;
			for (int i = 0; i < c; i++) {
				if (n % primes[i] == 0) {
					prevX = n / primes[i];
					ans += n / primes[i];
					currentn = primes[i];
					prevP = primes[i];
					// prestart
					for (int j = i + 1; j < c; j++)
						if (n % primes[j] == 0)
							ans += (n / primes[j]);
					break;
				}

			}

			while (prevX != 2 && currentn * (prevX - 1) < n) {
				currentn = currentn * (prevX - 1);
				ans += (prevX - 1);
				for (int i = 0; i < c; i++) {
					if (primes[i] != prevP && currentn % primes[i] == 0) {
						ans += (currentn / primes[i]);
						prevX = currentn / primes[i];
						prevP = primes[i];
					}
				}
			}
			System.out.println(ans * 4);
		}

	}

	static int sieveOfEratosthenes(int n) {
		// Create a boolean array "prime[0..n]" and initialize
		// all entries it as true. A value in prime[i] will
		// finally be false if i is Not a prime, else true.

		for (int i = 0; i < n; i++)
			prime[i] = true;

		for (int p = 2; p * p <= n; p++) {
			// If prime[p] is not changed, then it is a prime
			if (prime[p] == true) {
				// Update all multiples of p
				for (int i = p * 2; i <= n; i += p)
					prime[i] = false;
			}
		}
		int c = 0;
		// Print all prime numbers
		for (int i = 2; i <= n; i++) {
			if (prime[i] == true)
				primes[c++] = i;
		}
		return c;
	}
}