01.var
02.p:int64;
03.c,a,b,i:longint;
04.function try(x:longint):int64;
05.var
06.i,k:longint;
07.begin
08.k:=0;
09.for i:=1 to x div 2 do
10.if x mod i=0 then k:=k+i;
11.try:=k;
12.end;
13.begin
14.read(a,b);
15.for i:=a to b do
16.begin
17.p:=try(i);
18.if i<p then
19.if p-i<=100000 then
20.if i=try(p) then
21.c:=c+1;
22.end;
23.writeln(c);
24.end