import java.util.Scanner;

public class Main {

	public static int digit(int n) {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	}
	
	public static int sumdigit(int n) {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		}
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static int digit(int n) {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	}
	
	public static int sumdigit(int n) {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		}
		System.out.println(ans);
	}

} Main public static int digit(int n) {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	} digit {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	} int tmp = n; tmp n if(n == 0)return 1; n == 0 n 0 return 1; 1 int count = 0; count 0 while(tmp != 0) {
			tmp /= 10;
			++count;
		} tmp != 0 tmp 0 {
			tmp /= 10;
			++count;
		} tmp /= 10 tmp 10 ++count count return count; count int n n public static int sumdigit(int n) {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	} sumdigit {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	} int d = digit(n); d digit(n) digit n int tmp = n tmp n sum = 0; sum 0 for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		} int i = 0; int i = 0; i 0 i < d i d ++i ++i i {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		} {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		} int tmp2 = tmp / 10; tmp2 tmp / 10 tmp 10 tmp -= tmp2 * 10 tmp tmp2 * 10 tmp2 10 sum += tmp sum tmp tmp = tmp2 tmp tmp2 return sum; sum int n n public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= 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 a =sc.nextInt() a sc.nextInt() sc.nextInt sc 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 tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		} int i = 1; int i = 1; i 1 i <= n i n ++i ++i i {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		} {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		} int tmp = sumdigit(i); tmp sumdigit(i) sumdigit i if(tmp >= a && tmp <= b)ans += i; tmp >= a && tmp <= b tmp >= a tmp a tmp <= b tmp 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 int digit(int n) {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	}
	
	public static int sumdigit(int n) {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		}
		System.out.println(ans);
	}

} public class Main {

	public static int digit(int n) {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	}
	
	public static int sumdigit(int n) {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		}
		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {

	public static int digit(int n) {
		int tmp = n;
		if(n == 0)return 1;
		int count = 0;
		while(tmp != 0) {
			tmp /= 10;
			++count;
		}
		return count;
	}
	
	public static int sumdigit(int n) {
		int d = digit(n);
		int tmp = n, sum = 0;
		for(int i = 0; i < d; ++i) {
			int tmp2 = tmp / 10;
			tmp -= tmp2 * 10;
			sum += tmp;
			tmp = tmp2;
		}
		return sum;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a =sc.nextInt(), b = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i = 1; i <= n; ++i) {
			int tmp = sumdigit(i);
			if(tmp >= a && tmp <= b)ans += i;
		}
		System.out.println(ans);
	}

}
