import java.util.Scanner;

/**
 * Created by Manabu on 8/16/19.
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    }

    private static int digitSum(int num) {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

        return sum;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    }

    private static int digitSum(int num) {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

        return sum;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N N A A B; B N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner A = scanner.nextInt() A scanner.nextInt() scanner.nextInt scanner B = scanner.nextInt() B scanner.nextInt() scanner.nextInt scanner int result = 0; result 0 for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        } {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        } int sum = digitSum(i); sum digitSum(i) digitSum i if (sum >= A && sum <= B) {
                result += i;
            } sum >= A && sum <= B sum >= A sum A sum <= B sum B {
                result += i;
            } result += i result i System.out.println(result) System.out.println System.out System System.out result String[] args args private static int digitSum(int num) {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

        return sum;
    } digitSum {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

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

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    }

    private static int digitSum(int num) {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

        return sum;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    }

    private static int digitSum(int num) {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

        return sum;
    }
} Main
import java.util.Scanner;

/**
 * Created by Manabu on 8/16/19.
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N, A, B;

        N = scanner.nextInt();
        A = scanner.nextInt();
        B = scanner.nextInt();

        //helper(0, A, B, C, X);

        int result = 0;

        for (int i = 1; i <= N; i++) {
            int sum = digitSum(i);
            if (sum >= A && sum <= B) {
                result += i;
            }
        }

        System.out.println(result);
    }

    private static int digitSum(int num) {
        int sum = 0;

        while (num > 0) {
            sum += (num % 10);
            num /= 10;
        }

        return sum;
    }
}