import java.util.*;

public class Main {
	
	public static int sumDigit( int num ) {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	}

	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 sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	}

} import java.util.*; util.* java public class Main {
	
	public static int sumDigit( int num ) {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	}

	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 sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	}

} Main public static int sumDigit( int num ) {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	} sumDigit {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	} int sum = 0; sum 0 int n = num; n num while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		} n > 0 n 0 {
			sum += n % 10;
			n = n / 10;
		} sum += n % 10 sum n % 10 n 10 n = n / 10 n n / 10 n 10 return sum; sum int num num 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 sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	} main {
		
		Scanner sc = new Scanner( System.in );
		
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	} 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 sumnum = 0; sumnum 0 for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		} int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		} {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		} if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			} A <= sumDigit(i) && sumDigit(i) <= B A <= sumDigit(i) A sumDigit(i) sumDigit i sumDigit(i) <= B sumDigit(i) sumDigit i B {
				sumnum += i;
			} sumnum += i sumnum i System.out.println(sumnum) System.out.println System.out System System.out sumnum String[] args args public class Main {
	
	public static int sumDigit( int num ) {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	}

	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 sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	}

} public class Main {
	
	public static int sumDigit( int num ) {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	}

	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 sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	}

} Main
import java.util.*;

public class Main {
	
	public static int sumDigit( int num ) {
		
		int sum = 0;
		int n = num;
		
		while ( n > 0 ) {
			sum += n % 10;
			n = n / 10;
		}
		
		return sum;
	}

	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 sumnum = 0;
		
		for (int i = 1; i < N + 1; i++) {
			
			if ( A <= sumDigit(i) && sumDigit(i) <= B ) {
				sumnum += i;
			}
			
		}
		System.out.println(sumnum);

	}

}