program main
  implicit none
  
  integer :: n,a,b,m,i,j,s,h,sn,cou=0
  
  read(*,*)n,a,b
  
  do i = 1, n
    s = 0
    if (i <= 9) then
      s = i
    else if (i <= 99) then
      j = int(i/10)
      o = i - j*10
      s = j + o
    else if (i <= 999) then
      h = int(i/100)
      j = int((i - h*100)/10)
      o = i - h*100 - j*10
      s = h+j+o
    else if (i <= 9999) then
      sn = int(i/1000)
      h = int((i - sn*1000)/100)
      j = int((i - sn*1000 - h*100)/10)
      o = i - sn*1000 - h*100 - j*10
      s = sn+h+j+o
    end if
    
    if (a <= s) .and. (s <= b) then
      cou = cou + 1
    end if
  end do
  
  write(*,*)cou
end program main