
# coding: utf-8
lr = gets().chop.split(" ")
l  = lr[0].to_i
r  = lr[1].to_i
y = 1
x = 1
cnt = 0

for x in l..r
  for y in l..r
    
    if(y%x==y^x)
     cnt += 1
    end
        
  end
  if(x>y)
    break
  end

end

puts cnt