Under construction

Still being built. Things may change

Cool Numbers

Time limit1sMemory limit128 MB

Summary
Count integers in [a, b] that are both a perfect square and a perfect cube, meaning perfect sixth powers.
Level

Easy3 of 10

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

Problem

Eric likes interesting numbers such as 64. It turns out that 64 is both a perfect square and a perfect cube, since 64=8264 = 8^2 and 64=4364 = 4^3. Eric calls such numbers cool.

Write a program that counts how many integers in a given range are cool.

Input

The first line contains an integer aa with 1≤a≤1081 \le a \le 10^8.

The second line contains an integer bb with a≤b≤108a \le b \le 10^8.

Output

Print the number of cool numbers in the inclusive range from aa to bb (both aa and bb are counted if they are cool).

Examples2

  1. Example 1

    Input
    1
    100
    
    Expected output
    2
    
  2. Example 2

    Input
    100
    1000
    
    Expected output
    1