#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *, double *);
double sqrt(double);
int main() {
  double a, b, i, c, n, ans = 0;
  while (scanf("%lf %lf", &a, &b) != EOF) {
    if (a == 0)
      continue;
    for (i = a; i <= b; i++) {
      n = (int)(sqrt(i));
      c = sqrt(i);
      if (c - n == 0)
        ans++;
    }
    printf("%.0lf\n", ans);
    ans = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
je     1235 <main+0x105>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1188 <main+0x58>
jp     1188 <main+0x58>
jmp    1147 <main+0x17>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1217 <main+0xe7>
movsd  -0x20(%rbp),%xmm0
call   1050 <sqrt@plt>
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11fb <main+0xcb>
jp     11fb <main+0xcb>
movsd  0xe0f(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1200 <main+0xd0>
movsd  0xdf8(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1192 <main+0x62>
movsd  -0x38(%rbp),%xmm0
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1147 <main+0x17>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e8e(%rip),%rbx
cmp    (%rbx),%rax
jne    116f <main+0x3f>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
xorpd  %xmm0,%xmm0
lea    0xe8e(%rip),%r14
lea    0x18(%rsp),%r15
lea    0x8(%rsp),%r13
lea    0xe85(%rip),%r12
jmp    11b3 <main+0x83>
nopl   (%rax)
mov    %r12,%rdi
movapd %xmm4,%xmm0
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
cmp    (%rbx),%rax
xorpd  %xmm0,%xmm0
je     115f <main+0x2f>
movsd  0x18(%rsp),%xmm3
ucomisd %xmm0,%xmm3
jne    11c1 <main+0x91>
jnp    119c <main+0x6c>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm3,%xmm0
xorpd  %xmm1,%xmm1
jb     1190 <main+0x60>
xorpd  %xmm5,%xmm5
jmp    1225 <main+0xf5>
nopl   0x0(%rax,%rax,1)
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
subsd  %xmm0,%xmm4
movapd %xmm5,%xmm0
movsd  0xe08(%rip),%xmm2
addsd  %xmm2,%xmm0
cmpeqsd %xmm1,%xmm4
andpd  %xmm4,%xmm0
andnpd %xmm5,%xmm4
orpd   %xmm0,%xmm4
addsd  %xmm2,%xmm3
movsd  0x8(%rsp),%xmm0
ucomisd %xmm3,%xmm0
movapd %xmm4,%xmm5
jb     1190 <main+0x60>
xorps  %xmm4,%xmm4
sqrtsd %xmm3,%xmm4
ucomisd %xmm1,%xmm3
movapd %xmm4,%xmm0
movsd  %xmm3,0x10(%rsp)
movapd %xmm5,0x30(%rsp)
jae    1267 <main+0x137>
movapd %xmm3,%xmm0
movapd %xmm4,0x20(%rsp)
call   1050 <sqrt@plt>
movapd 0x30(%rsp),%xmm5
movapd 0x20(%rsp),%xmm4
movsd  0x10(%rsp),%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
jae    11e0 <main+0xb0>
movapd %xmm0,0x20(%rsp)
movapd %xmm3,%xmm0
call   1050 <sqrt@plt>
movapd 0x30(%rsp),%xmm5
movsd  0x10(%rsp),%xmm3
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm4
movapd 0x20(%rsp),%xmm0
jmp    11e0 <main+0xb0>

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %7
br label %8
8: ; preds = %40, %15, %0
%9 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %43
12: ; preds = %8
%13 = load double, double* %2
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
br label %8
16: ; preds = %12
%17 = load double, double* %2
store double %17, double* %4
br label %18
18: ; preds = %37, %16
%19 = load double, double* %4
%20 = load double, double* %3
%21 = fcmp ole double %19, %20
br i1 %21, label %22, label %40
22: ; preds = %18
%23 = load double, double* %4
%24 = call double @sqrt(double %23)
%25 = fptosi double %24 to i32
%26 = sitofp i32 %25 to double
store double %26, double* %6
%27 = load double, double* %4
%28 = call double @sqrt(double %27)
store double %28, double* %5
%29 = load double, double* %5
%30 = load double, double* %6
%31 = fsub double %29, %30
%32 = fcmp oeq double %31, 0.000000e+00
br i1 %32, label %33, label %36
33: ; preds = %22
%34 = load double, double* %7
%35 = fadd double %34, 1.000000e+00
store double %35, double* %7
br label %36
36: ; preds = %33, %22
br label %37
37: ; preds = %36
%38 = load double, double* %4
%39 = fadd double %38, 1.000000e+00
store double %39, double* %4
br label %18
40: ; preds = %18
%41 = load double, double* %7
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %41)
store double 0.000000e+00, double* %7
br label %8
43: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %35, label %8
8: ; preds = %0, %31
%9 = load double, double* %1
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %31, label %11
11: ; preds = %8
%12 = load double, double* %2
%13 = fcmp ugt double %9, %12
br i1 %13, label %28, label %14
14: ; preds = %11, %14
%15 = phi double [ %24, %14 ], [ 0.000000e+00, %11 ]
%16 = phi double [ %25, %14 ], [ %9, %11 ]
%17 = call double @sqrt(double %16)
%18 = fptosi double %17 to i32
%19 = sitofp i32 %18 to double
%20 = call double @sqrt(double %16)
%21 = fsub double %20, %19
%22 = fcmp oeq double %21, 0.000000e+00
%23 = fadd double %15, 1.000000e+00
%24 = select i1 %22, double %23, double %15
%25 = fadd double %16, 1.000000e+00
%26 = load double, double* %2
%27 = fcmp ugt double %25, %26
br i1 %27, label %28, label %14
28: ; preds = %14, %11
%29 = phi double [ 0.000000e+00, %11 ], [ %24, %14 ]
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %29)
br label %31
31: ; preds = %28, %8
%32 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%33 = load i64, i64* @EOF
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %8
35: ; preds = %31, %0
ret i32 0
}