N=io.read("n")
A=io.read("n")
B=io.read("n")
function d(a)
  local s=0
  while (a>0) do
    s=s+a%10
    a=a//10
  end
  return s
end
local total=0
for i=1,N do
  if d(i)>=A and d(i)<=B then
    total=total+i
  end
end
print(total)