var P,Q,cuoi,dau:int64; Begin readln(p,q); if sqrt(p)=trunc(sqrt(p)) then dau:=trunc(sqrt(p)) else dau:=trunc(sqrt(p))+1; cuoi:=trunc(sqrt(q)); write(cuoi-dau+1); End.