Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/for/primes-in-a-range

Primes in a range

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Medium 1000 ms 64 MB 48%
Share

Positive integers and are given. Determine how many prime numbers there are among the numbers from to (including and ).

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

Counting the primes in a range

Input

One line with two positive integers: and .

Output

One integer — the number of primes.

Note

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.