import java.util.*;

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 count = 0;
        int entire_sum = 0;
        for(int i = 1; i <= n; i++) {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        }
        System.out.println(entire_sum);
    }
} import java.util.*; util.* java 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 count = 0;
        int entire_sum = 0;
        for(int i = 1; i <= n; i++) {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        }
        System.out.println(entire_sum);
    }
} 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 count = 0;
        int entire_sum = 0;
        for(int i = 1; i <= n; i++) {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        }
        System.out.println(entire_sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        int entire_sum = 0;
        for(int i = 1; i <= n; i++) {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        }
        System.out.println(entire_sum);
    } 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 count = 0; count 0 int entire_sum = 0; entire_sum 0 for(int i = 1; i <= n; i++) {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        } {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        } int sum = 0; sum 0 int m = i; m i while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            } m > 0 m 0 { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            } sum += m % 10 sum m % 10 m 10 m /= 10 m 10 if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                entire_sum += i;
                count++;
            } entire_sum += i entire_sum i count++ count System.out.println(entire_sum) System.out.println System.out System System.out entire_sum String[] args args
import java.util.*;

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 count = 0;
        int entire_sum = 0;
        for(int i = 1; i <= n; i++) {
            int sum = 0;
            int m = i;
            while(m > 0) { //各桁の合計を計算
                sum += m % 10;
                m /= 10;
            }
            if(a <= sum && sum <= b) {
                entire_sum += i;
                count++;
            }
        }
        System.out.println(entire_sum);
    }
}