import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

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

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main static void solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	} solve {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	} 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 s = 0 s 0 t = 0; t 0 while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		} N>=A N A {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		} boolean ok = true; ok true s = 0 s 0 for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch); char ch (""+N).toCharArray() (""+N).toCharArray (""+N) "" N s+=Character.getNumericValue(ch); s+=Character.getNumericValue(ch) s Character.getNumericValue(ch) Character.getNumericValue Character ch if (s>=A && s<=B) t+=N; s>=A && s<=B s>=A s A s<=B s B t+=N t N N-- N System.out.println(t) System.out.println System.out System System.out t sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), A = sc.nextInt(), B = sc.nextInt(), s = 0, t = 0;
		while (N>=A) {
			boolean ok = true; s = 0;
			for (char ch : (""+N).toCharArray()) s+=Character.getNumericValue(ch);
			if (s>=A && s<=B) t+=N;
			N--;
		}
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}
