#include #include #include

using namespace std;

typedef long long dint; #ifdef WIN32 #define lld “%I64d” #else #define lld “%lld” #endif #define _l (long long int)

const int maxn = 50009;

dint n, s; int tp, pn[maxn], u[maxn], fc[maxn], tf; bool pr[maxn];

void pre() { memset(pr, 0, sizeof(pr)); u[1] = 1; tp = 0; for (int i = 2; i < maxn; ++ i) { if (!pr[i]) { pn[tp ++] = i; u[i] = -1; } for (int j = 0, v; j < tp && i * pn[j] < maxn; ++ j) { pr[v = i * pn[j]] = 1; if (i % pn[j] == 0) { u[v] = 0; break; } else u[v] = -u[i]; } } }

int cntFac(int v) { int s(0); for (int i = 0; i < tf && fc[i] <= v; ++ i) s += u[fc[i]] * (v / fc[i]); return s; }

int main() { #ifndef ONLINE_JUDGE freopen(".in", “r”, stdin); #endif

pre();
scanf(lld, &n);
s = 0;
for (dint b = 1; b * b <= n; ++ b) {
	dint nx(n / b);
	tf = 0;
	for (int i = 1; i * i <= b; ++ i) 
		if (b % i == 0) {
			if (u[i])
				fc[tf ++] = i;
			if (i * i < b && u[b / i])
				fc[tf ++] = b / i;
		}
	sort(fc, fc + tf);
	for (dint a = 1, j; a < b && a + b <= nx; a = j + 1) {
		j = nx / (nx / (a + b)) - b;
		if (j >= b)
			j = b - 1;
		s += (nx / (a + b)) * (cntFac(j) - cntFac(a - 1));
	}
}
printf(lld "\n", s);

}