#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n, a, b;
    cin >> n >> a >> b;

    int ans = 0;
    for (int i = 1; i <= n; i++)
    {
        int t = i, tt = 0;
        while (t)
            tt += t % 10, t /= 10;
        ans += i * (tt >= a && tt <= b);
    }
    cout << ans << '\n';

    return 0;
}
