import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;

public class Euler708 {

    static long isqrtU64(long x) {
        if (x < 0)
            return 0; // equivalent to unsigned behavior if larger than max
        long r = (long) Math.sqrt(x);
        while ((r + 1) <= x / (r + 1))
            ++r;
        while (r > 0 && r > x / r)
            --r;
        return r;
    }

    static List<Integer> sievePrimes(int limit) {
        List<Integer> primes = new ArrayList<>();
        if (limit < 2)
            return primes;

        byte[] isPrime = new byte[limit + 1];
        java.util.Arrays.fill(isPrime, (byte) 1);
        isPrime[0] = isPrime[1] = 0;

        for (int i = 2; i * i <= limit; ++i) {
            if (isPrime[i] != 0) {
                for (int j = i * i; j <= limit; j += i) {
                    isPrime[j] = 0;
                }
            }
        }

        for (int i = 2; i <= limit; ++i) {
            if (isPrime[i] != 0)
                primes.add(i);
        }
        return primes;
    }

    static class Solver708 {
        long n;
        List<Integer> primes;
        Map<Long, Long> alphaCache;

        Solver708(long n) {
            this.n = n;
            this.primes = sievePrimes((int) isqrtU64(n));
            this.alphaCache = new HashMap<>((int) Math.min(n, 1000000));
        }

        long alpha(long x) {
            if (x <= 1)
                return x;
            if (alphaCache.containsKey(x))
                return alphaCache.get(x);

            long r = isqrtU64(x);
            BigInteger s = BigInteger.ZERO;

            for (long i = 1; i <= r;) {
                long q = x / i;
                long j = Math.min(r, x / q);
                s = s.add(BigInteger.valueOf(q).multiply(BigInteger.valueOf(j - i + 1)));
                i = j + 1;
            }

            BigInteger ansBi = s.multiply(BigInteger.valueOf(2))
                    .subtract(BigInteger.valueOf(r).multiply(BigInteger.valueOf(r)));
            long ans = ansBi.longValue();
            alphaCache.put(x, ans);
            return ans;
        }

        BigInteger dfs(long a, int i) {
            if (a > n)
                return BigInteger.ZERO;

            BigInteger res = BigInteger.valueOf(alpha(n / a));

            for (int j = i + 1; j < primes.size(); ++j) {
                long p = primes.get(j);
                if (a > n / p / p)
                    break;

                long pp = p * p;
                BigInteger w = BigInteger.ONE;

                while (a <= n / pp) {
                    res = res.add(w.multiply(dfs(a * pp, j)));
                    if (pp > n / p)
                        break;
                    pp *= p;
                    w = w.shiftLeft(1);
                }
            }
            return res;
        }

        String solve() {
            return dfs(1, -1).toString();
        }
    }

    public static String solve() {
        long N = 100000000000000L;
        Solver708 solver = new Solver708(N);
        return solver.solve();
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
