import java.util.Scanner;

class Main{
    public static void main(String[] args){
        int n, a, b;
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();

        int ans = 0;
        int tmp;
        int x;
        int t;
        for(int i = 1; i <= n; i++){
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        }

        System.out.println(ans);

        sc.close();
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        int n, a, b;
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();

        int ans = 0;
        int tmp;
        int x;
        int t;
        for(int i = 1; i <= n; i++){
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        }

        System.out.println(ans);

        sc.close();
    }
} Main public static void main(String[] args){
        int n, a, b;
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();

        int ans = 0;
        int tmp;
        int x;
        int t;
        for(int i = 1; i <= n; i++){
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        }

        System.out.println(ans);

        sc.close();
    } main {
        int n, a, b;
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();

        int ans = 0;
        int tmp;
        int x;
        int t;
        for(int i = 1; i <= n; i++){
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        }

        System.out.println(ans);

        sc.close();
    } int n n a a b; b Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int tmp; tmp int x; x int t; t for(int i = 1; i <= n; i++){
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        } {
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        } tmp = i tmp i x = 0 x 0 while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            } tmp != 0 tmp 0 {
                x += tmp % 10;
                tmp /= 10;
            } x += tmp % 10 x tmp % 10 tmp 10 tmp /= 10 tmp 10 if(a <= x && x <= b) ans += i; a <= x && x <= b a <= x a x x <= b x b ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        int n, a, b;
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();

        int ans = 0;
        int tmp;
        int x;
        int t;
        for(int i = 1; i <= n; i++){
            tmp = i;
            x = 0;
            while(tmp != 0){
                x += tmp % 10;
                tmp /= 10;
            }

            if(a <= x && x <= b) ans += i;
        }

        System.out.println(ans);

        sc.close();
    }
}