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 sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    }
} 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 sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    }
} 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 sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    } 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 sum = 0; sum 0 int sumans = 0; sumans 0 int check = 0; check 0 for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        } {
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        } check = i check i while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            } check >= 1 check 1 {
                sum = sum + check%10;
                check = check / 10;
            } sum = sum + check%10 sum sum + check%10 sum check%10 check 10 check = check / 10 check check / 10 check 10 if(a <= sum && sum <= b){
                sumans = sumans + i;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                sumans = sumans + i;
            } sumans = sumans + i sumans sumans + i sumans i sum = 0 sum 0 System.out.print(sumans) System.out.print System.out System System.out sumans 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 sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    }
} 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 sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    }
} Main
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 sum = 0;
        int sumans = 0;
        int check = 0;
        for(int i = 1; i <= n; i++){
            check = i;
            while(check >= 1){
                sum = sum + check%10;
                check = check / 10;
            }
            if(a <= sum && sum <= b){
                sumans = sumans + i;
            }
            sum = 0;
        }
        System.out.print(sumans);
    }
}