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 digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=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();
		int ans=0;

		for(int i=1; i <=n ; i++) {
			int digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=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();
		int ans=0;

		for(int i=1; i <=n ; i++) {
			int digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=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 digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=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 digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=b) {
				ans += i;
			}
		} int i=1; int i=1; i 1 i <=n i n i++ i++ i {
			int digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=b) {
				ans += i;
			}
		} {
			int digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=b) {
				ans += i;
			}
		} int digitSum=0; digitSum 0 int now = i; now i while (now>0) {
				digitSum += now%10;
				now /= 10;
			} now>0 now 0 {
				digitSum += now%10;
				now /= 10;
			} digitSum += now%10 digitSum now%10 now 10 now /= 10 now 10 if (digitSum>=a&&digitSum<=b) {
				ans += i;
			} digitSum>=a&&digitSum<=b digitSum>=a digitSum a digitSum<=b digitSum 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 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 digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=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();
		int ans=0;

		for(int i=1; i <=n ; i++) {
			int digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=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();
		int ans=0;

		for(int i=1; i <=n ; i++) {
			int digitSum=0;
			int now = i;
			while (now>0) {
				digitSum += now%10;
				now /= 10;
			}
			if (digitSum>=a&&digitSum<=b) {
				ans += i;
			}
		}
		System.out.println(ans);
//------------------------------------------------------------
	}
}