#P7884. Count Primes

    ID: 21069 Type: Default 1000ms 256MiB

Count Primes

Count Primes

Given an integer \(n\), calculate \(\pi(n)\), which represents the number of prime numbers between 1 and \(n\) (inclusive).

inputFormat

The input consists of a single integer \(n\) (\(1 \leq n \leq 10^7\)).

outputFormat

Output a single integer, the value of \(\pi(n)\), which is the count of prime numbers between 1 and \(n\) (inclusive).

sample

10
4