PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000156. Đếm hợp số lũy thừa nguyên tố trong đoạn (Almost Prime Numbers)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm hợp số lũy thừa nguyên tố trong đoạn (Almost Prime Numbers)

Almost Prime Numbers

Source: UVa 10539
Version: Phuoc Hung OJ Extended — one dataset per judge run.

Problem Statement

An almost-prime number is a composite integer with exactly one distinct prime divisor, equivalently pkp^k with prime pp and k≥2k\ge2. Given LL and RR, count such values in the inclusive interval [L,R][L,R].

Input

One line containing LL and RR.

Output

Print the number of almost-primes in [L,R][L,R].

Subtasks

  • Subtask 1 (20 points): 1≤L≤R≤1000001\le L\le R\le 100000.
  • Subtask 2 (30 points): 1≤L≤R≤10000000001\le L\le R\le 1000000000.
  • Subtask 3 (50 points): 1≤L≤R≤9999999999991\le L\le R\le 999999999999.

Example

Input

1 20

Output

4

Explanation

The values are 4=224=2^2, 8=238=2^3, 9=329=3^2, and 16=2416=2^4. Thus there are four almost-primes.