luogu#P7884. 【模板】Meissel-Lehmer

【模板】Meissel-Lehmer

Problem Description

Given an integer nn, find the value of π(n)\pi(n).

π(n)\pi(n) denotes the number of prime numbers among the integers from 11 to nn.

Input Format

One line with one integer nn.

Output Format

One line with one integer, representing the required value.

10
4

Hint

For 100%100\% of the testdata, 1n10131 \leq n \leq 10^{13}.

Translated by ChatGPT 5