#include <iostream>
#include <string>
using namespace std;
int sum(int n)
{
    int ret = 0;
    while (n)
    {
        ret += n % 10;
        n /= 10;
    }
    return ret;
}
int main()
{
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    int ans = 0;
    for (int i = 1; i <= n; i++)
    {
        int s = sum(i);
        if (a <= s && s <= b)
            ans += i;
    }
    cout << ans << '\n';
    return 0;
}