// Prime counting benchmark
#include <stdio.h>
#include <stdint.h>

int isPrime(int64_t n) {
    if (n < 2) return 0;
    for (int64_t i = 2; i * i <= n; i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int64_t countPrimes(int64_t max) {
    int64_t count = 0;
    for (int64_t i = 2; i <= max; i++) {
        if (isPrime(i)) count++;
    }
    return count;
}

int main() {
    int64_t count = countPrimes(10000);
    printf("primes up to 10000: %lld\n", count);
    return 0;
}
