#include <iostream>
#include <cmath>
using namespace std;
bool checkSoCP(int n){
int temp= sqrt(n);
if(temp*temp == n) return 1;
else return 0;
}
int main() {
int l,r;
cin>>l>>r;
int ans=0;
for(int i=l+1;i<r;i++){
if(checkSoCP(i)) ans++;
}
cout<<ans<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmJvb2wgY2hlY2tTb0NQKGludCBuKXsKCWludCB0ZW1wPSBzcXJ0KG4pOwoJaWYodGVtcCp0ZW1wID09IG4pIHJldHVybiAxOwoJZWxzZSByZXR1cm4gMDsKCn0KaW50IG1haW4oKSB7CglpbnQgbCxyOwoJY2luPj5sPj5yOwoJaW50IGFucz0wOwoJZm9yKGludCBpPWwrMTtpPHI7aSsrKXsKCQlpZihjaGVja1NvQ1AoaSkpIGFucysrOwoJfQoJY291dDw8YW5zPDxlbmRsOwoJcmV0dXJuIDA7Cn0=