Module Module083B

    Sub Main(ByVal args() As String)
        Dim N As Integer
        Dim A As Integer
        Dim B As Integer
        Dim i, j As Integer
        Dim i_str As String
        Dim tmp As Integer : tmp = 0
        Dim result As Integer : result = 0

        Dim arr(3) As String

        arr = Split(Console.ReadLine())
        N = Integer.Parse(arr(0))
        A = Integer.Parse(arr(1))
        B = Integer.Parse(arr(2))

        For i = 0 To N
            tmp = 0
            i_str = i.ToString
            For j = 0 To i_str.Length - 1
                tmp = tmp + Integer.Parse(i_str(j))
            Next
            If A <= tmp And tmp <= B Then
                result = result + i
            End If
        Next

        Console.Write(result)
    End Sub
End Module
