import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args) {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  } main {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  } Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) String[] inputs = sc.nextLine().split(" "); inputs sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int N = Integer.parseInt(inputs[0]); N Integer.parseInt(inputs[0]) Integer.parseInt Integer inputs[0] inputs 0 int A = Integer.parseInt(inputs[1]); A Integer.parseInt(inputs[1]) Integer.parseInt Integer inputs[1] inputs 1 int B = Integer.parseInt(inputs[2]); B Integer.parseInt(inputs[2]) Integer.parseInt Integer inputs[2] inputs 2 List<Integer> answer = new ArrayList<>(); answer new ArrayList<>() for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    } int n = 1; int n = 1; n 1 n <= N n N n++ n++ n {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    } {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    } if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      } n < 10 n 10 {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } if (n >= A && n <= B) {
          answer.add(n);
        } n >= A && n <= B n >= A n A n <= B n B {
          answer.add(n);
        } answer.add(n) answer.add answer n {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      } String[] nString = String.valueOf(n).split(""); nString String.valueOf(n).split("") String.valueOf(n).split String.valueOf(n) String.valueOf String n "" int sum = 0; sum 0 for (String ns: nString) {
          sum += Integer.parseInt(ns);
        } String ns nString {
          sum += Integer.parseInt(ns);
        } {
          sum += Integer.parseInt(ns);
        } sum += Integer.parseInt(ns) sum Integer.parseInt(ns) Integer.parseInt Integer ns if (sum >= A && sum <= B) {
          answer.add(n);
        } sum >= A && sum <= B sum >= A sum A sum <= B sum B {
          answer.add(n);
        } answer.add(n) answer.add answer n Integer sum = 0; sum 0 for (Integer ans: answer) {
      sum += ans;
    } Integer ans answer {
      sum += ans;
    } {
      sum += ans;
    } sum += ans sum ans System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new java.util.Scanner(System.in);
    String[] inputs = sc.nextLine().split(" ");
    int N = Integer.parseInt(inputs[0]);
    int A = Integer.parseInt(inputs[1]);
    int B = Integer.parseInt(inputs[2]);
    List<Integer> answer = new ArrayList<>();

    for (int n = 1; n <= N; n++) {
      if (n < 10) {
        if (n >= A && n <= B) {
          answer.add(n);
        }
      } else {
        String[] nString = String.valueOf(n).split("");
        int sum = 0;
        for (String ns: nString) {
          sum += Integer.parseInt(ns);
        }
        if (sum >= A && sum <= B) {
          answer.add(n);
        }
      }
    }
    Integer sum = 0;
    for (Integer ans: answer) {
      sum += ans;
    }
    System.out.println(sum);
  }
}
