import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    }
} import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    }
} Main public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    } main {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner sc = new Scanner(inputStream); sc new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      } {
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      } int n = i; n i int digSum = 0; digSum 0 while(0 < n){
          digSum += n % 10;
          n /= 10;
        } 0 < n 0 n {
          digSum += n % 10;
          n /= 10;
        } digSum += n % 10 digSum n % 10 n 10 n /= 10 n 10 if(A <= digSum && digSum <= B){
        	ans += i;
        } A <= digSum && digSum <= B A <= digSum A digSum digSum <= B digSum B {
        	ans += i;
        } ans += i ans i out.println(ans) out.println out ans out.close() out.close out String[] args args public class Main{
	public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    }
} public class Main{
	public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int N = Integer.parseInt(sc.next());
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int ans = 0;
      for(int i = 1; i <= N; i++){
        int n = i;
        int digSum = 0;
      	while(0 < n){
          digSum += n % 10;
          n /= 10;
        }
        if(A <= digSum && digSum <= B){
        	ans += i;
        }
      }
      out.println(ans);
      out.close();
    }
}