import java.util.Scanner;

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

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    }

    private static int calcSumOfDigits(int i) {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int res = 0;

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    }

    private static int calcSumOfDigits(int i) {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int res = 0;

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int res = 0;

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int res = 0; res 0 for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        } int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        } {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        } int sumDigits = calcSumOfDigits(i); sumDigits calcSumOfDigits(i) calcSumOfDigits i if (A <= sumDigits && sumDigits <= B) {
                res += i;
            } A <= sumDigits && sumDigits <= B A <= sumDigits A sumDigits sumDigits <= B sumDigits B {
                res += i;
            } res += i res i System.out.println(res) System.out.println System.out System System.out res String[] args args private static int calcSumOfDigits(int i) {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    } calcSumOfDigits {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    } int tmp = i; tmp i int sumDigits = 0; sumDigits 0 while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        } tmp > 0 tmp 0 {
            sumDigits += tmp % 10;
            tmp /= 10;
        } sumDigits += tmp % 10 sumDigits tmp % 10 tmp 10 tmp /= 10 tmp 10 return sumDigits; sumDigits int i i public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int res = 0;

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    }

    private static int calcSumOfDigits(int i) {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int res = 0;

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    }

    private static int calcSumOfDigits(int i) {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    }
} Main
import java.util.Scanner;

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

        for (int i = 0; i <= N; i++) {
            int sumDigits = calcSumOfDigits(i);
            if (A <= sumDigits && sumDigits <= B) {
                res += i;
            }
        }
        System.out.println(res);
    }

    private static int calcSumOfDigits(int i) {
        int tmp = i;
        int sumDigits = 0;
        while (tmp > 0) {
            sumDigits += tmp % 10;
            tmp /= 10;
        }
        return sumDigits;
    }
}
