import java.util.Scanner;

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

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    }

    static int sum(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int A = cin.nextInt();
        int B = cin.nextInt();

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    }

    static int sum(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int A = cin.nextInt();
        int B = cin.nextInt();

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    } main {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int A = cin.nextInt();
        int B = cin.nextInt();

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int N = cin.nextInt(); N cin.nextInt() cin.nextInt cin int A = cin.nextInt(); A cin.nextInt() cin.nextInt cin int B = cin.nextInt(); B cin.nextInt() cin.nextInt cin int s = 0; s 0 for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        } {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        } int x = sum(i); x sum(i) sum i if (x >= A && x <= B) {
                s += i;
            } x >= A && x <= B x >= A x A x <= B x B {
                s += i;
            } s += i s i System.out.println(s) System.out.println System.out System System.out s String[] args args static int sum(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } sum {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } int sum = 0; sum 0 while (n > 0) {
            sum += n % 10;
            n /= 10;
        } n > 0 n 0 {
            sum += n % 10;
            n /= 10;
        } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int A = cin.nextInt();
        int B = cin.nextInt();

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    }

    static int sum(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int A = cin.nextInt();
        int B = cin.nextInt();

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    }

    static int sum(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main
import java.util.Scanner;

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

        int s = 0;
        for (int i = 1; i <= N; i++) {
            int x = sum(i);
            if (x >= A && x <= B) {
                s += i;
            }
        }

        System.out.println(s);
    }

    static int sum(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
}