Under construction

Still being built. Things may change

RSA Numbers

Interview

Time limit1sMemory limit128 MB

Summary
Count how many integers in an inclusive range below 1000 have exactly four divisors, then print the count in a fixed sentence.
Level

Easy3 of 10

Topics
Math, Number theory, Brute force, Implementation
Solved
No attempts yet

Problem

A number is an RSA number if it has exactly four divisors — that is, exactly four positive integers divide it evenly. For example, 1010 is an RSA number because it has exactly four divisors (1,2,5,101, 2, 5, 10). 1212 is not an RSA number because it has too many divisors (1,2,3,4,6,121, 2, 3, 4, 6, 12), and 1111 is not one either (its only divisors are 11 and 1111). So there is exactly one RSA number in the range 10…1210 \dots 12.

Write a program that reads a range of numbers and counts how many numbers in that range are RSA numbers. You may assume that every number in the range is less than 10001000.

(The name comes from the RSA encryption that many web browsers use to protect information such as credit-card numbers sent over the Internet.)

Input

Two integers aa and bb (a≤ba \le b) are given: the inclusive lower and upper bounds of the range. Each number is less than 10001000.

Output

Print a single line in exactly the following form:

The number of RSA numbers between a and b is c

where aa and bb are the given bounds and cc is the number of RSA numbers in the range [a,b][a, b].

Examples2

  1. Example 1

    Input
    10
    12
    
    Expected output
    The number of RSA numbers between 10 and 12 is 1
    
  2. Example 2

    Input
    11
    15
    
    Expected output
    The number of RSA numbers between 11 and 15 is 2