import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
} import java.io.*; io.* java public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	} main {
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	} BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in)); bfr new BufferedReader(new InputStreamReader(System.in)) String str = bfr.readLine(); str bfr.readLine() bfr.readLine bfr String[] wa = str.split(" "); wa str.split(" ") str.split str " " int N = Integer.parseInt(wa[0]); N Integer.parseInt(wa[0]) Integer.parseInt Integer wa[0] wa 0 int a = Integer.parseInt(wa[1]); a Integer.parseInt(wa[1]) Integer.parseInt Integer wa[1] wa 1 int b = Integer.parseInt(wa[2]); b Integer.parseInt(wa[2]) Integer.parseInt Integer wa[2] wa 2 int sum = 0; sum 0 for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		} {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		} int tmpSum = 0; tmpSum 0 int num = i; num i while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			} num != 0 num 0 {
				tmpSum += num %10;
				num /= 10;
			} tmpSum += num %10 tmpSum num %10 num 10 num /= 10 num 10 if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			} tmpSum >= a && tmpSum <= b tmpSum >= a tmpSum a tmpSum <= b tmpSum b {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
} Main
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
}