import java.util.Scanner;
public class Main {
	public static int sum(int a) {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static int sum(int a) {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	}

} Main public static int sum(int a) {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	} sum {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	} int ans = 0; ans 0 while(a >= 10) {
			ans += a%10;
			a /= 10;
		} a >= 10 a 10 {
			ans += a%10;
			a /= 10;
		} ans += a%10 ans a%10 a 10 a /= 10 a 10 ans += a ans a return ans; ans int a a public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	} main {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int N = stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int A = stdIn.nextInt(); A stdIn.nextInt() stdIn.nextInt stdIn int B = stdIn.nextInt(); B stdIn.nextInt() stdIn.nextInt stdIn int Ans = 0; Ans 0 for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		} {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		} if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			} A <= sum(i) && sum(i) <= B A <= sum(i) A sum(i) sum i sum(i) <= B sum(i) sum i B {
				Ans += i;
			} Ans += i Ans i System.out.println(Ans) System.out.println System.out System System.out Ans String[] args args public class Main {
	public static int sum(int a) {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	}

} public class Main {
	public static int sum(int a) {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	}

} Main
import java.util.Scanner;
public class Main {
	public static int sum(int a) {
		int ans = 0;
		while(a >= 10) {
			ans += a%10;
			a /= 10;
		}
		ans += a;
		return ans;
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int Ans = 0;
		
		for(int i = 1; i <= N; i++) {
			if(A <= sum(i) && sum(i) <= B) {
				Ans += i;
			}
		}
		System.out.println(Ans);

	}

}