#include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int pt[1000000];

int main() {
    int n;
    scanf("%d", &n);
    int ans = 0;
    for (int i = 2; i <= n; i++) if (pt[i] == 0) {
        ans++;
        for (int j = i+i; j <= n; j+=i) pt[j] = i;
    }
    printf("%d\n", ans);
    return 0;
}