#include <stdio.h>
#include <math.h>
int main ()
{
int a,b,n,i ,cnt ;
while (scanf ("%d %d",&a,&b) == 2 && a!=0 && b!=0)
{
cnt = 0 ;
for (i=a ; i<=b ; i++)
{
n = sqrt (i) ;
if (n*n == i) cnt++ ;
}
printf ("%d\n",cnt) ;
}
return 0 ;
}
#include <math.h>
int main ()
{
int a,b,n,i ,cnt ;
while (scanf ("%d %d",&a,&b) == 2 && a!=0 && b!=0)
{
cnt = 0 ;
for (i=a ; i<=b ; i++)
{
n = sqrt (i) ;
if (n*n == i) cnt++ ;
}
printf ("%d\n",cnt) ;
}
return 0 ;
}