import java.lang.*;
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    }
} import java.lang.*; lang.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int result = 0; result 0 for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        } {
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        } int kari = i+1; kari i+1 i 1 int atai = 0; atai 0 while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            } kari!=0 kari 0 {
                atai += (kari%10);
                kari = (int)(kari/10);
            } atai += (kari%10) atai (kari%10) kari 10 kari = (int)(kari/10) kari (int)(kari/10) kari 10 if(atai>=a&&atai<=b){
                result += i+1;
            } atai>=a&&atai<=b atai>=a atai a atai<=b atai b {
                result += i+1;
            } result += i+1 result i+1 i 1 System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    }
} Main
import java.lang.*;
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for(int i = 0;i<n;i++){
            int kari = i+1;
            int atai = 0;
            while(kari!=0){
                atai += (kari%10);
                kari = (int)(kari/10);
            }
            if(atai>=a&&atai<=b){
                result += i+1;
            }
        }
        System.out.println(result);
        sc.close();
    }
}