

import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

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

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

	}
} Main public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

	} 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 sumsum = 0; sumsum 0 for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		} {
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		} String num = Integer.toString(i); num Integer.toString(i) Integer.toString Integer i int sum = 0; sum 0 for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			} int j = 0; int j = 0; j 0 j < num.length() j num.length() num.length num j++ j++ j {
				sum += num.charAt(j) - '0';
			} {
				sum += num.charAt(j) - '0';
			} sum += num.charAt(j) - '0' sum num.charAt(j) - '0' num.charAt(j) num.charAt num j '0' if(sum >= a && sum <= b){
				sumsum += i;
			} sum >= a && sum <= b sum >= a sum a sum <= b sum b {
				sumsum += i;
			} sumsum += i sumsum i System.out.println(sumsum) System.out.println System.out System System.out sumsum String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

	}
} public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

	}
} Main


import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int sumsum = 0;
		for(int i = 1; i <= n; i++){
			String num = Integer.toString(i);

			int sum = 0;
			for(int j = 0; j < num.length(); j++){
				sum += num.charAt(j) - '0';
			}

			if(sum >= a && sum <= b){
				sumsum += i;
			}
		}
		System.out.println(sumsum);

	}
}
