import java.util.Scanner;

public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		}

		private static int sum(int i) {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		}
} import java.util.Scanner; Scanner java.util public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		}

		private static int sum(int i) {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		}
} Main public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		} main {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans=0; ans 0 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 sc.close() sc.close sc for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			} {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			} int sum = sum(i); sum sum(i) sum i if (A <= sum && sum <= B) {
					ans+=i;
				} A <= sum && sum <= B A <= sum A sum sum <= B sum B {
					ans+=i;
				} ans+=i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static int sum(int i) {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		} sum {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		} int sumDigits = 0; sumDigits 0 while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			} i != 0 i 0 {
				sumDigits += i % 10;
				i /= 10;
			} sumDigits += i % 10 sumDigits i % 10 i 10 i /= 10 i 10 return sumDigits; sumDigits int i i public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		}

		private static int sum(int i) {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		}
} public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		}

		private static int sum(int i) {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		}
} Main
import java.util.Scanner;

public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int ans=0;
			int N = sc.nextInt();
			int A = sc.nextInt();
			int B = sc.nextInt();
			sc.close();

			for (int i = 1; i <= N; i++) {
				int sum = sum(i);
				if (A <= sum && sum <= B) {
					ans+=i;
				}
			}

			System.out.println(ans);
		}

		private static int sum(int i) {
			int sumDigits = 0;
			while( i != 0) {
				sumDigits += i % 10;
				i /= 10;
			}
			return sumDigits;
		}
}