1. 

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 11461 - Square Numbers
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=26&page=show_problem&problem=2456
*
* @author Evgeni Pavlidis
* @version 1.0, 06/02/2010
*
* Method : Precalculation - Look up table
* Status : Accepted
* Runtime: 0.008
*/

#include <iostream>
using namespace std;

#define MAX 100000

int main()
{
int table[MAX+1];

int j,c;
for(int i = 0; i <= MAX; i++)
table[i] = 0;

for(int i = 1; i*i <= MAX; i++)
table[i*i] = 1;

c = 0;
for(int i = 1; i <= MAX; i++)
{
if(table[i] == 1)
c++;
table[i] = c;
}

int a,b;

while(true)
{
cin >> a >> b;
if(a == 0 && b == 0)
return 0;

cout << (table[b] - table[a-1]) << endl;
}
}