#include <cstdio>
#include <unordered_map>
#define lint long long
#define MAX 300003
lint mu[MAX] = {0, 1}; // 편의상 mu[0] = 0이라 둔다.
std::unordered_map<int, lint> mp;
lint S(int x) {
int i, j;
if (x < MAX) return mu[x];
if (mp.find(x) != mp.end()) return mp[x];
lint ret = 1;
for (i = 2; i <= x; i = j+1) {
j = x / (x / i);
ret -= (j - i + 1) * S(x / i);
}
return mp[x] = ret;
}
int main()
{
int N, i, j;
scanf("%d", &N);
for (i = 1; i < MAX; ++i) {
for (j = 2; j*i < MAX; ++j) mu[j*i] -= mu[i];
mu[i] += mu[i-1];
}
printf("%lld", S(N));
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPHVub3JkZXJlZF9tYXA+CiNkZWZpbmUgbGludCBsb25nIGxvbmcKI2RlZmluZSBNQVggMzAwMDAzCgpsaW50IG11W01BWF0gPSB7MCwgMX07IC8vIO2OuOydmOyDgSBtdVswXSA9IDDsnbTrnbwg65GU64ukLgpzdGQ6OnVub3JkZXJlZF9tYXA8aW50LCBsaW50PiBtcDsKCmxpbnQgUyhpbnQgeCkgewoJaW50IGksIGo7CglpZiAoeCA8IE1BWCkgcmV0dXJuIG11W3hdOwoJaWYgKG1wLmZpbmQoeCkgIT0gbXAuZW5kKCkpIHJldHVybiBtcFt4XTsKCWxpbnQgcmV0ID0gMTsKCWZvciAoaSA9IDI7IGkgPD0geDsgaSA9IGorMSkgewoJCWogPSB4IC8gKHggLyBpKTsKCQlyZXQgLT0gKGogLSBpICsgMSkgKiBTKHggLyBpKTsKCX0KCXJldHVybiBtcFt4XSA9IHJldDsKfQoKaW50IG1haW4oKQp7CglpbnQgTiwgaSwgajsKCXNjYW5mKCIlZCIsICZOKTsKCglmb3IgKGkgPSAxOyBpIDwgTUFYOyArK2kpIHsKCQlmb3IgKGogPSAyOyBqKmkgPCBNQVg7ICsraikgbXVbaippXSAtPSBtdVtpXTsKCQltdVtpXSArPSBtdVtpLTFdOwoJfQoKCXByaW50ZigiJWxsZCIsIFMoTikpOwoJcmV0dXJuIDA7Cn0=