import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int result = 0; result 0 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 for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        } {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        } String val = String.valueOf(i); val String.valueOf(i) String.valueOf String i int some = 0; some 0 for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            } int j = 0; int j = 0; j 0 j < val.length() j val.length() val.length val j++ j++ j {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            } {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            } some = some + Integer.parseInt(String.valueOf(val.charAt(j))) some some + Integer.parseInt(String.valueOf(val.charAt(j))) some Integer.parseInt(String.valueOf(val.charAt(j))) Integer.parseInt Integer String.valueOf(val.charAt(j)) String.valueOf String val.charAt(j) val.charAt val j if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            } a <= some && b >= some a <= some a some b >= some b some {
                result = result + Integer.valueOf(val);
            } result = result + Integer.valueOf(val) result result + Integer.valueOf(val) result Integer.valueOf(val) Integer.valueOf Integer val System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            String val = String.valueOf(i);
            int some = 0;
            for (int j = 0; j < val.length(); j++) {
                some = some + Integer.parseInt(String.valueOf(val.charAt(j)));
            }
            if (a <= some && b >= some) {
                result = result + Integer.valueOf(val);
            }
        }
        System.out.println(result);
    }
}