import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N N A A B B ans=0; ans 0 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 for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N ++i ++i i {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		} {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		} int C = i C i D=0; D 0 while(C > 0) {
				D += C%10;
				C /= 10;
			} C > 0 C 0 {
				D += C%10;
				C /= 10;
			} D += C%10 D C%10 C 10 C /= 10 C 10 if(A <= D && D <= B) {
				ans+=i;
			} A <= D && D <= B A <= D A D D <= B D 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 void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	}
} Main
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N,A,B,ans=0;
		N = sc.nextInt();
		A = sc.nextInt();
		B = sc.nextInt();

		for(int i = 1; i <= N; ++i) {
			int C = i, D=0;
			while(C > 0) {
				D += C%10;
				C /= 10;
			}
			if(A <= D && D <= B) {
				ans+=i;
			}
		}

		System.out.println(ans);
	}
}
