import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int min = sc.nextInt(); min sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc int a [] = new int[n]; a new int[n] n int sum = 0; sum 0 for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		} {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		} a[i] = i+1 a[i] a i i+1 i 1 int e = a[i]; e a[i] a i int dig = 0; dig 0 while(e != 0) {
				dig += e %10;
				e /= 10;
			} e != 0 e 0 {
				dig += e %10;
				e /= 10;
			} dig += e %10 dig e %10 e 10 e /= 10 e 10 if(min <= dig && dig <= max) {
				sum += a[i];
			} min <= dig && dig <= max min <= dig min dig dig <= max dig max {
				sum += a[i];
			} sum += a[i] sum a[i] a i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = sc.nextInt();
		int max = sc.nextInt();
		int a [] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			a[i] = i+1;
			int e = a[i];
			int dig = 0;
			while(e != 0) {
				dig += e %10;
				e /= 10;
			}
			if(min <= dig && dig <= max) {
				sum += a[i];
			}
		}
		System.out.println(sum);
	}
}
