import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	} 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 sc.close() sc.close sc int ans = 0; ans 0 for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		} int i = 1; int i = 1; i 1 i <= N i N ++i ++i i {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		} {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		} int num = i; num i int x = 0; x 0 for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			} int j = (int)Math.log10(N); int j = (int)Math.log10(N); j (int)Math.log10(N) Math.log10 Math N j >= 0 j 0 --j --j j {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			} {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			} x += num / (int)Math.pow(10, j) x num / (int)Math.pow(10, j) num (int)Math.pow(10, j) Math.pow Math 10 j num = i % (int)Math.pow(10, j) num i % (int)Math.pow(10, j) i (int)Math.pow(10, j) Math.pow Math 10 j if(A <= x && x <= B)
				ans += i; A <= x && x <= B A <= x A x x <= B x B 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 sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = 1;i <= N;++i) {
			int num = i;
			int x = 0;
			for(int j = (int)Math.log10(N);j >= 0;--j) {
				x += num / (int)Math.pow(10, j);
				num = i % (int)Math.pow(10, j);
			}
			if(A <= x && x <= B)
				ans += i;
		}
		System.out.println(ans);
	}
}
