import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  }
} 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 n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int n4 n4 n3 n3 n2 n2 n1 n1 n; n int count = 0; count 0 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++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    } {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    } n4 = i / 1000 n4 i / 1000 i 1000 n3 = i / 100 - n4*10 n3 i / 100 - n4*10 i / 100 i 100 n4*10 n4 10 n2 = i / 10 - n4*100 - n3*10 n2 i / 10 - n4*100 - n3*10 i / 10 - n4*100 - n3*10 i / 10 i 10 n4*100 n4 100 n3*10 n3 10 n1 = i % 10 n1 i % 10 i 10 n = n1+n2+n3+n4 n n1+n2+n3+n4 n3 n1+n2+n3+n4 n1 n2 n3 n4 if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      } i == 10000 i 10000 {
        count += 10000;
      } count += 10000 count 10000 if(n>=A && n<=B) {
        count += i;
      } n>=A && n<=B n>=A n A n<=B n B {
        count += i;
      } count += i count i System.out.println(count) System.out.println System.out System System.out count String args[] args public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  }
} public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int n4, n3, n2, n1,n;
    int count = 0;
    int A = sc.nextInt();
    int B = sc.nextInt();
    for(int i=1; i<=N; i++) {
      n4 = i / 1000;
      n3 = i / 100 - n4*10;
      n2 = i / 10 - n4*100 - n3*10;
      n1 = i % 10;
      n = n1+n2+n3+n4;
      if(i == 10000) {
        count += 10000;
      } else if(n>=A && n<=B) {
        count += i;
      }
    }
    System.out.println(count);
  }
}