import java.util.*;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    }
	  static boolean judge(int n, int a, int b){
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	}
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    }
	  static boolean judge(int n, int a, int b){
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	}
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    } main {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	} int i=0; int i=0; i 0 i<=N i N i++ i++ i {
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	} {
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	} if (judge(i, A, B)){
    			ans += i;
    		} judge(i, A, B) judge i A B {
    			ans += i;
    		} ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args static boolean judge(int n, int a, int b){
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	} judge {
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	} int x = 0; x 0 while(n>0){
			x += n % 10;
			n = n /10;
		} n>0 n 0 {
			x += n % 10;
			n = n /10;
		} x += n % 10 x n % 10 n 10 n = n /10 n n /10 n 10 if (x >= a && x<= b){
			return true;
		}else{
			return false;
		} x >= a && x<= b x >= a x a x<= b x b {
			return true;
		} return true; true {
			return false;
		} return false; false int n n int a a int b b public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    }
	  static boolean judge(int n, int a, int b){
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	}
} public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    }
	  static boolean judge(int n, int a, int b){
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	}
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = Integer.parseInt(sc.next());
    	int A = Integer.parseInt(sc.next());
    	int B = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=0; i<=N; i++){
    		if (judge(i, A, B)){
    			ans += i;
    		}
    	}

    	System.out.println(ans);

    }
	  static boolean judge(int n, int a, int b){
		int x = 0;
		while(n>0){
			x += n % 10;
			n = n /10;
		}
		if (x >= a && x<= b){
			return true;
		}else{
			return false;
		}
	}
}