#jag2017autumnc. [jag2017autumn_c]Prime-Factor Prime
[jag2017autumn_c]Prime-Factor Prime
MathJax.Hub.Config({ tex2jax: { inlineMath: [[""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 16px; line-height: 18px; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }
Problem Statement
A positive integer is called a "prime-factor prime" when the number of its prime factors is prime. For example, is a prime-factor prime because the number of prime factors of is , which is prime. On the other hand, is not a prime-factor prime because the number of prime factors of is , which is a composite number.
In this problem, you are given an integer interval \[l, r\]. Your task is to write a program which counts the number of prime-factor prime numbers in the interval, i.e. the number of prime-factor prime numbers between and , inclusive.
Input
The input consists of a single test case formatted as follows.
A line contains two integers and (), which presents an integer interval \[l, r\]. You can assume that .
Output
Print the number of prime-factor prime numbers in \[l, r\].
Sample Input 1
1 9
Output for Sample Input 1
4
Sample Input 2
10 20
Output for Sample Input 2
6
Sample Input 3
575 57577
Output for Sample Input 3
36172
Sample Input 4
180 180
Output for Sample Input 4
1
Sample Input 5
9900001 10000000
Output for Sample Input 5
60997
Sample Input 6
999000001 1000000000
Output for Sample Input 6
592955
Note
In the first example, there are 4 prime-factor primes in \[l, r\]: , , , and .