Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/for-oraliqdagi-tub-sonlar

Primes in a range

Medium 1000 ms 64 MB 48%
Share

Positive integers $a$ and $b$ are given ($a \le b$). Determine how many prime numbers there are among the numbers from $a$ to $b$ (including $a$ and $b$).

A prime number is a positive integer greater than $1$ that is divisible only by $1$ and itself ($1$ is not prime).

Counting the primes in a range

Input

One line with two positive integers: $a$ and $b$.

Output

One integer — the number of primes.

Note

$1 \le a \le b \le 10^{4}$

Examples

Input #1
1 10
Output #1
4
Input #2
10 20
Output #2
4

Sign in to submit a solution

Signing up is free and takes a minute.