import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	int N;
	int A;
	int B;
	public void run() {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();
		int ans = 0;
		for(int i=1; i<=N; i++) {
			int sum=0;
			int v = i;
			while(v != 0) {
				sum += v % 10;
				v = v/10;
			}
			if(A <= sum && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

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

	int N;
	int A;
	int B;
	public void run() {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();
		int ans = 0;
		for(int i=1; i<=N; i++) {
			int sum=0;
			int v = i;
			while(v != 0) {
				sum += v % 10;
				v = v/10;
			}
			if(A <= sum && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	int N;
	int A;
	int B;
	public void run() {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();
		int ans = 0;
		for(int i=1; i<=N; i++) {
			int sum=0;
			int v = i;
			while(v != 0) {
				sum += v % 10;
				v = v/10;
			}
			if(A <= sum && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	int N;
	int A;
	int B;
	public void run() {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();
		int ans = 0;
		for(int i=1; i<=N; i++) {
			int sum=0;
			int v = i;
			while(v != 0) {
				sum += v % 10;
				v = v/10;
			}
			if(A <= sum && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
}