import java.util.Scanner;

//  B - Some Sums

public class Main {
  public static void main(String[] args ) throws Exception {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  }

  public static int kesan(int i) {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args ) throws Exception {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  }

  public static int kesan(int i) {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  }
} Main public static void main(String[] args ) throws Exception {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  } main {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int totalAll = 0; totalAll 0 for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	} int i = 1; int i = 1; i 1 i <= A i A i++ i++ i {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	} {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	} int total = kesan(i); total kesan(i) kesan i if(total >= B && total <= C) {

			totalAll += i;
		} total >= B && total <= C total >= B total B total <= C total C {

			totalAll += i;
		} totalAll += i totalAll i System.out.println(totalAll) System.out.println System.out System System.out totalAll String[] args args public static int kesan(int i) {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  } kesan {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  } int total = 0; total 0 while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		} true {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		} if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			} i / 10 > 0 i / 10 i 10 0 {
				total += i % 10;
				i /= 10;
			} total += i % 10 total i % 10 i 10 i /= 10 i 10 {
				total += i;
				return total;
			} total += i total i return total; total int i i public class Main {
  public static void main(String[] args ) throws Exception {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  }

  public static int kesan(int i) {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  }
} public class Main {
  public static void main(String[] args ) throws Exception {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  }

  public static int kesan(int i) {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  }
} Main
import java.util.Scanner;

//  B - Some Sums

public class Main {
  public static void main(String[] args ) throws Exception {

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());


    int totalAll = 0;
	for(int i = 1; i <= A; i++) {
		int total = kesan(i);
		if(total >= B && total <= C) {

			totalAll += i;
		}
	}


    System.out.println(totalAll);
  }

  public static int kesan(int i) {
		int total = 0;
		while(true) {
			if(i / 10 > 0) {
				total += i % 10;
				i /= 10;
			} else {
				total += i;
				return total;
			}
		}

  }
}