Imports System

Public Class Program

    Public Shared Sub Main()

        Dim InputString() As String = Console.ReadLine.Split(" ")
        Dim N As Integer = InputString(0)
        Dim A As Integer = InputString(1)
        Dim B As Integer = InputString(2)

        Dim answer As Integer = 0

        For i As Integer = 1 To N

            Dim X As Integer = i \ 1000
            X += (i \ 100) Mod 10
            X += (i \ 10) Mod 10
            X += i Mod 10

            If (X >= A) AndAlso (X <= B) Then
                answer += i
            End If

        Next

        Console.WriteLine(answer)

    End Sub
End Class