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;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
	static boolean check(int n,int a,int b) {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= 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 = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
	static boolean check(int n,int a,int b) {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= b) {
			return true;
		}else {
			return false;
		}
	}
} 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;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(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 sum = 0; sum 0 for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		} int i=1 ; int i=1 ; i 1 i<=n i n i++ i++ i {
			if(check(i,a,b)) {
				sum += i;
			}
		} {
			if(check(i,a,b)) {
				sum += i;
			}
		} if(check(i,a,b)) {
				sum += i;
			} check(i,a,b) check i a b {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String args[] args static boolean check(int n,int a,int b) {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= b) {
			return true;
		}else {
			return false;
		}
	} check {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= b) {
			return true;
		}else {
			return false;
		}
	} int sum=0; sum 0 while(n != 0) {
			sum += (n%10);
			n /= 10;
		} n != 0 n 0 {
			sum += (n%10);
			n /= 10;
		} sum += (n%10) sum (n%10) n 10 n /= 10 n 10 if(sum >= a && sum <= b) {
			return true;
		}else {
			return false;
		} sum >= a && sum <= b sum >= a sum a sum <= b sum 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 = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
	static boolean check(int n,int a,int b) {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= b) {
			return true;
		}else {
			return false;
		}
	}
} 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;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
	static boolean check(int n,int a,int b) {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= 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 = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0;
		for(int i=1 ; i<=n ; i++) {
			if(check(i,a,b)) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
	static boolean check(int n,int a,int b) {
		int sum=0;
		while(n != 0) {
			sum += (n%10);
			n /= 10;
		}
		if(sum >= a && sum <= b) {
			return true;
		}else {
			return false;
		}
	}
}
