import java.util.Scanner;

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 tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	}

	static int calcSumofDigits(int n) {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	}
} import java.util.Scanner; Scanner 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 tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	}

	static int calcSumofDigits(int n) {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	}
} 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 tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	} 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 tot = 0; tot 0 for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		} int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		} {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		} int ans = calcSumofDigits(i); ans calcSumofDigits(i) calcSumofDigits i if (a <= ans && ans <= b) {
				tot += i;
			} a <= ans && ans <= b a <= ans a ans ans <= b ans b {
				tot += i;
			} tot += i tot i System.out.println(tot) System.out.println System.out System System.out tot String[] args args static int calcSumofDigits(int n) {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	} calcSumofDigits {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	} int ans = 0; ans 0 while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		} n > 0 n 0 {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		} ans += n % 10 ans n % 10 n 10 n = n / 10 n n / 10 n 10 return ans; ans int n n 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 tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	}

	static int calcSumofDigits(int n) {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	}
} 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 tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	}

	static int calcSumofDigits(int n) {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	}
} Main
import java.util.Scanner;

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 tot = 0;

		for (int i = 0; i <= n; i++) {
			int ans = calcSumofDigits(i);
//			System.out.print(" ans_out "+ ans);
//			System.out.println(" i "+ i);
			if (a <= ans && ans <= b) {
				tot += i;
			}

		}
		System.out.println(tot);
	}

	static int calcSumofDigits(int n) {
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n = n / 10;
//   			System.out.println(" ans "+ ans);
//   			System.out.println(" n "+ n);
		}
		return ans;
	}
}
