import java.util.Scanner;
public class Main {
  public static void main( String[] args ) {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main( String[] args ) {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  }
} Main public static void main( String[] args ) {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  } main {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan int ans = 0; ans 0 int i_tmp = 0; i_tmp 0 for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  } {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  } i_tmp = i i_tmp i int divide = 10; divide 10 int sum = 0; sum 0 int digit = 1; digit 1 while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  } true {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  } if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  } i_tmp / divide >= 10 i_tmp / divide i_tmp divide 10 {
				  digit++;
				  divide *= 10;
			  } digit++ digit divide *= 10 divide 10 {
				  divide /= 10;
				  break;
			  } divide /= 10 divide 10 break; divide = (int)Math.pow( 10, digit ) divide (int)Math.pow( 10, digit ) Math.pow Math 10 digit while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  } true {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  } sum += i_tmp / divide sum i_tmp / divide i_tmp divide if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  } i_tmp < 10 i_tmp 10 {
				  sum += i_tmp % 10;
				  break;
			  } sum += i_tmp % 10 sum i_tmp % 10 i_tmp 10 break; i_tmp = i_tmp % divide i_tmp i_tmp % divide i_tmp divide divide /= 10 divide 10 if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  } divide <= 10 divide 10 {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  } sum += i_tmp / 10 sum i_tmp / 10 i_tmp 10 sum += i_tmp % 10 sum i_tmp % 10 i_tmp 10 break; 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 public class Main {
  public static void main( String[] args ) {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  }
} public class Main {
  public static void main( String[] args ) {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  }
} Main
import java.util.Scanner;
public class Main {
  public static void main( String[] args ) {
	  Scanner scan = new Scanner(System.in);
	  int N = scan.nextInt();
	  int A = scan.nextInt();
	  int B = scan.nextInt();
	  int ans = 0;
	  int i_tmp = 0;
	  for( int i = 1; i <= N; i++ ) {
		  i_tmp = i;
		  int divide = 10;
		  int sum = 0;
		  int digit = 1;
		  while( true ) {
			  if( i_tmp / divide >= 10 ) {
				  digit++;
				  divide *= 10;
			  }else {
				  divide /= 10;
				  break;
			  }
		  }
		  divide = (int)Math.pow( 10, digit );
		  while( true ) {
			  sum += i_tmp / divide;
			  if( i_tmp < 10 ) {
				  sum += i_tmp % 10;
				  break;
			  }
			  i_tmp = i_tmp % divide;
			  divide /= 10;
			  if( divide <= 10 ) {
				  sum += i_tmp / 10;
				  sum += i_tmp % 10;
				  break;
			  }
		  }
		  if( A <= sum && sum <= B ){
			  ans += i;
		  }
	  }
	  System.out.println( ans );
  }
}
