
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	}

	static int conv(int val) {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	}

	static int conv(int val) {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	}
} Main public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) String[] tokens = in.readLine().split(" "); tokens in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int N = Integer.parseInt(tokens[0]); N Integer.parseInt(tokens[0]) Integer.parseInt Integer tokens[0] tokens 0 int A = Integer.parseInt(tokens[1]); A Integer.parseInt(tokens[1]) Integer.parseInt Integer tokens[1] tokens 1 int B = Integer.parseInt(tokens[2]); B Integer.parseInt(tokens[2]) Integer.parseInt Integer tokens[2] tokens 2 int result = 0; result 0 for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N ++i ++i i {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		} {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		} int conv = conv(i); conv conv(i) conv i if (conv >= A && conv <= B) {
				result += i;
			} conv >= A && conv <= B conv >= A conv A conv <= B conv B {
				result += i;
			} result += i result i System.out.println(result) System.out.println System.out System System.out result String[] args args static int conv(int val) {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	} conv {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	} String s = Integer.toString(val); s Integer.toString(val) Integer.toString Integer val int result = 0; result 0 for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s ++i ++i i {
			result += Integer.parseInt(s.substring(i, i + 1));
		} {
			result += Integer.parseInt(s.substring(i, i + 1));
		} result += Integer.parseInt(s.substring(i, i + 1)) result Integer.parseInt(s.substring(i, i + 1)) Integer.parseInt Integer s.substring(i, i + 1) s.substring s i i + 1 i 1 return result; result int val val public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	}

	static int conv(int val) {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	}

	static int conv(int val) {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	}
} Main

import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);

		String[] tokens = in.readLine().split(" ");
		int N = Integer.parseInt(tokens[0]);
		int A = Integer.parseInt(tokens[1]);
		int B = Integer.parseInt(tokens[2]);
		int result = 0;
		for (int i = 1; i <= N; ++i) {
			int conv = conv(i);
			if (conv >= A && conv <= B) {
				result += i;
			}
		}
		System.out.println(result);
	}

	static int conv(int val) {
		String s = Integer.toString(val);
		int result = 0;
		for (int i = 0; i < s.length(); ++i) {
			result += Integer.parseInt(s.substring(i, i + 1));
		}
		return result;
	}
}