import java.util.Scanner;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
    private static int f(int i) {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) throws Exception {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
    private static int f(int i) {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    }
} Main public static void main(String args[]) throws Exception {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    } main {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int a = s.nextInt(); a s.nextInt() s.nextInt s int b = s.nextInt(); b s.nextInt() s.nextInt s int t = 0; t 0 int sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        } {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        } t = f(i) t f(i) f i if (t >= a && t <= b) {
                sum += i;
            } t >= a && t <= b t >= a t a t <= b t b {
                sum += i;
            } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String args[] args private static int f(int i) {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    } f {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    } int sum = 0; sum 0 while (i > 0) {
            sum += i % 10;
            i = i / 10;
        } i > 0 i 0 {
            sum += i % 10;
            i = i / 10;
        } sum += i % 10 sum i % 10 i 10 i = i / 10 i i / 10 i 10 return sum; sum int i i public class Main {
    public static void main(String args[]) throws Exception {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
    private static int f(int i) {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    }
} public class Main {
    public static void main(String args[]) throws Exception {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
    private static int f(int i) {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = 0;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            t = f(i);
            if (t >= a && t <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
    private static int f(int i) {
        int sum = 0;
        while (i > 0) {
            sum += i % 10;
            i = i / 10;
        }
        return sum;
    }
}