
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	}

	public static int findSumOfDigits(int n) {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	}

	public static int findSumOfDigits(int n) {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	}
} Main public static void main(String[] args) {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	} main {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in int total = 0; total 0 for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  } {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  } int sum = findSumOfDigits(i); sum findSumOfDigits(i) findSumOfDigits i if(sum >= a && sum <= b) {
				  total += i;
			  } sum >= a && sum <= b sum >= a sum a sum <= b sum b {
				  total += i;
			  } total += i total i System.out.println(total) System.out.println System.out System System.out total in.close() in.close in String[] args args public static int findSumOfDigits(int n) {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	} findSumOfDigits {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	} 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 return sum; sum int n n public class Main {
	public static void main(String[] args) {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	}

	public static int findSumOfDigits(int n) {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	}
} public class Main {
	public static void main(String[] args) {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	}

	public static int findSumOfDigits(int n) {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
	//	  System.setIn(B083.class.getResourceAsStream("input.txt"));
		  Scanner in = new Scanner(System.in);

		  int n = in.nextInt();
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int total = 0;


		  for(int i = 0; i <= n; i++) {
			  int sum = findSumOfDigits(i);
			  if(sum >= a && sum <= b) {
				  total += i;
			  }
		  }
		  System.out.println(total);
		  in.close();
	}

	public static int findSumOfDigits(int n) {
		  int sum = 0;

		  while(n > 0) {
			  sum += n % 10;
			  n /= 10;
		  }
		  return sum;
	}
}
