import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    }

} Main public static void main(String[] args) {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    } main {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    } int n n a a b b digitsSum = 0 digitsSum 0 totalSum = 0; totalSum 0 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 for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        } {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        } int tmp = i; tmp i for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            } int j = 0; int j = 0; j 0 j < 5 j 5 j++ j++ j {
                digitsSum += tmp % 10;
                tmp /= 10;
            } {
                digitsSum += tmp % 10;
                tmp /= 10;
            } digitsSum += tmp % 10 digitsSum tmp % 10 tmp 10 tmp /= 10 tmp 10 if(a <= digitsSum && digitsSum <= b) totalSum += i; a <= digitsSum && digitsSum <= b a <= digitsSum a digitsSum digitsSum <= b digitsSum b totalSum += i totalSum i digitsSum = 0 digitsSum 0 System.out.println(totalSum) System.out.println System.out System System.out totalSum String[] args args public class Main {

    public static void main(String[] args) {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    }

} public class Main {

    public static void main(String[] args) {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n, a, b, digitsSum = 0, totalSum = 0;

        Scanner sc = new Scanner(System.in);

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

        for (int i = 1; i <= n; i++) {
            int tmp = i;
            for (int j = 0; j < 5; j++){
                digitsSum += tmp % 10;
                tmp /= 10;
            }
            if(a <= digitsSum && digitsSum <= b) totalSum += i;
            digitsSum = 0;
        }
        System.out.println(totalSum);
    }

}