import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] temp = br.readLine().split(" "); temp br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " Integer n = Integer.parseInt(temp[0]); n Integer.parseInt(temp[0]) Integer.parseInt Integer temp[0] temp 0 Integer a = Integer.parseInt(temp[1]); a Integer.parseInt(temp[1]) Integer.parseInt Integer temp[1] temp 1 Integer b = Integer.parseInt(temp[2]); b Integer.parseInt(temp[2]) Integer.parseInt Integer temp[2] temp 2 int p p sum sum res = 0; res 0 for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		} {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		} p = i p i sum = 0 sum 0 while(p > 0) {
				sum += p % 10;
				p /= 10;
			} p > 0 p 0 {
				sum += p % 10;
				p /= 10;
			} sum += p % 10 sum p % 10 p 10 p /= 10 p 10 if(a <= sum && b >= sum) res += i; a <= sum && b >= sum a <= sum a sum b >= sum b sum res += i res i System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] temp = br.readLine().split(" ");
		Integer n = Integer.parseInt(temp[0]);
		Integer a = Integer.parseInt(temp[1]);
		Integer b = Integer.parseInt(temp[2]);
		int p,sum,res = 0;
		for(int i=1;i<=n; i++) {
			p = i;
			sum = 0;
			while(p > 0) {
				sum += p % 10;
				p /= 10;
			}
			if(a <= sum && b >= sum) res += i;
		}
		System.out.println(res);
	}
}