import java.util.*;
public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    }
} import java.util.*; util.* java public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    } main {
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n n a a b; b 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 r = 0; r 0 for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        } {
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        } int c = 0 c 0 t = i; t i for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            } int j = 0; int j = 0; j 0 j < 5 j 5 j++ j++ j {
                c = c + (t % 10);
                t = t / 10;
            } {
                c = c + (t % 10);
                t = t / 10;
            } c = c + (t % 10) c c + (t % 10) c (t % 10) t 10 t = t / 10 t t / 10 t 10 if(a <= c && c<= b){
                r = r + i;
            } a <= c && c<= b a <= c a c c<= b c b {
                r = r + i;
            } r = r + i r r + i r i System.out.println(r) System.out.println System.out System System.out r String[] args args public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    }
} public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    }
} Main
import java.util.*;
public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        int r = 0;
        for(int i = 1; i <= n; i++){
            int c = 0, t = i;
            for(int j = 0; j < 5; j++){
                c = c + (t % 10);
                t = t / 10;
            }
            if(a <= c && c<= b){
                r = r + i;
            }
        }
        System.out.println(r);    
            
    }
}