import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	}
} import java.util.*; util.* java import java.math.*; math.* java import java.lang.*; lang.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	} 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 result = 0; result 0 for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		} {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		} int currentSum =0; currentSum 0 if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			} i>=1 i 1 {
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			} currentSum += i%10 currentSum i%10 i 10 if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				} i/10>=1 i/10 i 10 1 {
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				} currentSum += (i/10)%10 currentSum (i/10)%10 (i/10) i 10 10 if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					} i/100>=1 i/100 i 100 1 {
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					} currentSum += (i/100)%10 currentSum (i/100)%10 (i/100) i 100 10 if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						} i/1000>=1 i/1000 i 1000 1 {
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						} currentSum += (i/1000)%10 currentSum (i/1000)%10 (i/1000) i 1000 10 if(i/10000>=1){
								currentSum += (i/10000)%10;
							} i/10000>=1 i/10000 i 10000 1 {
								currentSum += (i/10000)%10;
							} currentSum += (i/10000)%10 currentSum (i/10000)%10 (i/10000) i 10000 10 if(currentSum>=a&& currentSum <=b){
				result += i;
			} currentSum>=a&& currentSum <=b currentSum>=a currentSum a currentSum <=b currentSum b {
				result += i;
			} result += i result i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	}
} Main
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int result = 0;

		for (int i = 1; i <= n; i++) {
			int currentSum =0;
			if(i>=1){
				currentSum += i%10;
				if(i/10>=1){
					currentSum += (i/10)%10;
					if(i/100>=1){
						currentSum += (i/100)%10;
						if(i/1000>=1){
							currentSum += (i/1000)%10;
							if(i/10000>=1){
								currentSum += (i/10000)%10;
							}
						}
					}
				}
			}
			// System.out.println("i "+i);
			// System.out.println("currentSum "+currentSum);
			if(currentSum>=a&& currentSum <=b){
				result += i;
			}
		}
		System.out.println(result);


	}
}
