local ior = io.read
local n, a, b = ior("*n", "*n", "*n")

local function getsum(x)
  local r = 0
  while(0 < x) do
    r = r + x % 10
    x = x // 10
  end
  return r
end

local ret = 0
for i = 1, n do
  local z = getsum(i)
  if(a <= z and z <= b) then ret = ret + i end
end
print(ret)
