#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define less Less
#define EPS 1e-4
#define arg ARG
#define cpdd const pdd
#define rank Rank
#define KK 500
#define MXN 200005
int main(){
    int n,a,b;
    while(scanf("%d %d %d",&n,&a,&b)!=EOF){
        int now=0;
        int ans=0;
        for(int i = 1;i<=n;i++){
            if(i%10000==0){
                now-=36;
            }
            else if(i%1000==0){
                now-=27;
            }
            else if(i%100==0){
                now-=18;
            }
            else if(i%10==0){
                now-=9;
            }
            now++;
            if(now>=a&&now<=b){
                ans+=i;
            }
        }
        printf("%d\n",ans);
    }
}