#include <bits/stdc++.h>
#define hi ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define pb push_back
#define emb emplace_back
#define mp make_pair
#define srt(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define count(a, n) count(a.begin(), a.end(), n)
#define reverse(a) reverse(a.begin(), a.end())
#define F first
#define S second
#define pii pair<int, int>
#define vi vector<int>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define de(x) cout << #x << " is " << x << '\n'
typedef long long ll;
using namespace std;
int sum(int n)
{
    int x = 0;
    while (n >= 1)
    {
        x += n % 10;
        n /= 10;
    }
    return x;
}
int main()
{
    hi;
    int n, a, b;
    ll res = 0;
    cin >> n >> a >> b;
    rep(i, 1, n + 1)
    {
        if (sum(i) >= a && sum(i) <= b)
            res += i;
    }
    cout << res << '\n';
    return 0;
}
