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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		}
		System.out.println(ans);
	}

	public static int sum(int num) {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	}
} 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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		}
		System.out.println(ans);
	}

	public static int sum(int num) {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	}
} 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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=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 int ans=0; ans 0 for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		} {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		} int temp = sum(i); temp sum(i) sum i if(temp>=a &&  temp <=b) ans+=i; temp>=a &&  temp <=b temp>=a temp a temp <=b temp b ans+=i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int sum(int num) {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	} sum {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	} int res = 0; res 0 while(num!=0) {
			res += num%10;
			num/=10;
		} num!=0 num 0 {
			res += num%10;
			num/=10;
		} res += num%10 res num%10 num 10 num/=10 num 10 return res; res int num num 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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		}
		System.out.println(ans);
	}

	public static int sum(int num) {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	}
} 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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		}
		System.out.println(ans);
	}

	public static int sum(int num) {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	}
} 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();
		int ans=0;
		for(int i=1;i<=N;i++) {
			int temp = sum(i);
			if(temp>=a &&  temp <=b) ans+=i;
		}
		System.out.println(ans);
	}

	public static int sum(int num) {
		int res = 0;
		while(num!=0) {
			res += num%10;
			num/=10;
		}
		return res;
	}
}
