import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	} main {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc final int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc final int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int result = 0; result 0 for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		} {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		} final String iList[] = (String.valueOf(i)).split(""); iList (String.valueOf(i)).split("") (String.valueOf(i)).split (String.valueOf(i)) String.valueOf String i "" int iTotal = 0; iTotal 0 for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			} final String item iList {
				iTotal = iTotal + Integer.parseInt(item);
			} {
				iTotal = iTotal + Integer.parseInt(item);
			} iTotal = iTotal + Integer.parseInt(item) iTotal iTotal + Integer.parseInt(item) iTotal Integer.parseInt(item) Integer.parseInt Integer item if (a <= iTotal && iTotal <= b) {
				result = result + i;
			} a <= iTotal && iTotal <= b a <= iTotal a iTotal iTotal <= b iTotal b {
				result = result + i;
			} result = result + i result result + i result i System.out.print(result) System.out.print System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

		int result = 0;
		for (int i = 1; i <= n; i++) {
			final String iList[] = (String.valueOf(i)).split("");
			int iTotal = 0;
			for (final String item : iList) {
				iTotal = iTotal + Integer.parseInt(item);
			}

			if (a <= iTotal && iTotal <= b) {
				result = result + i;
			}
		}

		System.out.print(result);

	}

}
