import 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 sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    public static int findSumOfDigits(int num) {
        int sum = 0;
        while(num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return sum;
    }
} import java.util.*; util.* java 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 sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    public static int findSumOfDigits(int num) {
        int sum = 0;
        while(num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return sum;
    }
} 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 sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    } 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 sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        } {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        } int sumOfDigits = findSumOfDigits(i); sumOfDigits findSumOfDigits(i) findSumOfDigits i if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            } a <= sumOfDigits && sumOfDigits <= b a <= sumOfDigits a sumOfDigits sumOfDigits <= b sumOfDigits b {
                sum += i;
            } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int findSumOfDigits(int num) {
        int sum = 0;
        while(num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return sum;
    } findSumOfDigits {
        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 sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    public static int findSumOfDigits(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 sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    public static int findSumOfDigits(int num) {
        int sum = 0;
        while(num > 0) {
            sum += num % 10;
            num /= 10;
        }
        return sum;
    }
} Main
import 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 sum = 0;
        for (int i = 1; i <= n; i++) {
            int sumOfDigits = findSumOfDigits(i);
            if (a <= sumOfDigits && sumOfDigits <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

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