import java.util.*;
import java.lang.*;

public class Main {
    public static int helper(int N, int A, int B) {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    }

    public static int sumDigit(int num) {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    }

    public static void main(String[] args) {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    public static int helper(int N, int A, int B) {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    }

    public static int sumDigit(int num) {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    }

    public static void main(String[] args) {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    }
} Main public static int helper(int N, int A, int B) {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    } helper {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    } int sum = 0; sum 0 for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        } int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        } {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        } int digsum = sumDigit(i); digsum sumDigit(i) sumDigit i if (digsum >= A && digsum <= B) {
                sum = sum + i;
            } digsum >= A && digsum <= B digsum >= A digsum A digsum <= B digsum B {
                sum = sum + i;
            } sum = sum + i sum sum + i sum i return sum; sum int N N int A A int B B public static int sumDigit(int num) {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    } sumDigit {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    } int digSum = 0; digSum 0 int pow = 0; pow 0 while (Math.pow(10,pow) < num) {
            pow++;
        } Math.pow(10,pow) < num Math.pow(10,pow) Math.pow Math 10 pow num {
            pow++;
        } pow++ pow for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        } int i = 0; int i = 0; i 0 i <= pow i pow i++ i++ i {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        } {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        } int digits = num / (int) Math.pow(10,i); digits num / (int) Math.pow(10,i) num (int) Math.pow(10,i) Math.pow Math 10 i digSum = digSum + (digits % 10) digSum digSum + (digits % 10) digSum (digits % 10) digits 10 return digSum; digSum int num num public static void main(String[] args) {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    } main {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    } Scanner dataScanner = new Scanner(System.in); dataScanner new Scanner(System.in) String[] data = dataScanner.nextLine().split(" "); data dataScanner.nextLine().split(" ") dataScanner.nextLine().split dataScanner.nextLine() dataScanner.nextLine dataScanner " " int intLim = Integer.parseInt(data[0]); intLim Integer.parseInt(data[0]) Integer.parseInt Integer data[0] data 0 int digLLim = Integer.parseInt(data[1]); digLLim Integer.parseInt(data[1]) Integer.parseInt Integer data[1] data 1 int digULim = Integer.parseInt(data[2]); digULim Integer.parseInt(data[2]) Integer.parseInt Integer data[2] data 2 int sum = helper(intLim, digLLim, digULim); sum helper(intLim, digLLim, digULim) helper intLim digLLim digULim System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static int helper(int N, int A, int B) {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    }

    public static int sumDigit(int num) {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    }

    public static void main(String[] args) {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    }
} public class Main {
    public static int helper(int N, int A, int B) {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    }

    public static int sumDigit(int num) {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    }

    public static void main(String[] args) {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {
    public static int helper(int N, int A, int B) {
        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            int digsum = sumDigit(i);
            if (digsum >= A && digsum <= B) {
                sum = sum + i;
            }
        }
        return sum;
    }

    public static int sumDigit(int num) {
        int digSum = 0;
        int pow = 0;
        while (Math.pow(10,pow) < num) {
            pow++;
        }
        for (int i = 0; i <= pow; i++) {
            int digits = num / (int) Math.pow(10,i);
            digSum = digSum + (digits % 10);
        }
        return digSum;
    }

    public static void main(String[] args) {
        Scanner dataScanner = new Scanner(System.in);
        String[] data = dataScanner.nextLine().split(" ");
        int intLim = Integer.parseInt(data[0]);
        int digLLim = Integer.parseInt(data[1]);
        int digULim = Integer.parseInt(data[2]);
        int sum = helper(intLim, digLLim, digULim);
      	System.out.println(sum);
    }
}
