
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		int sum = 0;
		for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		}
		
        System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		int sum = 0;
		for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		}
		
        System.out.println(sum);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		int sum = 0;
		for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		}
		
        System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		int sum = 0;
		for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		}
		
        System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int sum = 0; sum 0 for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		} int i = a; int i = a; i a 0 < i 0 i i-- i-- i {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		} {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i int temp = 0; temp 0 for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			} int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
				temp += Integer.parseInt(s.substring(j, j + 1));
			} {
				temp += Integer.parseInt(s.substring(j, j + 1));
			} temp += Integer.parseInt(s.substring(j, j + 1)) temp Integer.parseInt(s.substring(j, j + 1)) Integer.parseInt Integer s.substring(j, j + 1) s.substring s j j + 1 j 1 if (temp >= b && temp <= c) {
				sum += i;
			} temp >= b && temp <= c temp >= b temp b temp <= c temp c {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String args[] args

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		int sum = 0;
		for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		}
		
        System.out.println(sum);
	}
}