#include <iostream>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <cstring>
#include <string.h>
#include <sstream>
#include <iomanip>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
 
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const ll MOD = 1e9+7;
const double PI  = 3.14159265358;
const double EPS = 1e-8;

#define INT_MX 2147483647
#define INF ((int)1e9)
#define LLINF ((ll)1e18)
#define F first
#define S second
#define mp(x,y) make_pair(x,y)
#define sz(v) ((int)v.size())
#define rs(n) resize(n)
#define all(v) v.begin(),v.end()
#define reset(v) memset((v),0,sizeof(v))
#define EB emplace_back
#define pb push_back
#define pf push_front
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);


void solve(){
    int n, a, b, ct;
    ll ans;
    string s;
    
    ans = 0;
    
    cin >> n >> a >> b;
    rep1(i, n){
        s = to_string(i);
        ct = 0;
        for(auto i:s)
            ct += i - '0';
        if(ct >= a && ct <= b)
            ans += i;
    }
    cout << ans << '\n';
}

int main(){
    
    solve();
}



