import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    }
} 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 a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    }
} Main public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    } main {
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 int re = 0; re 0 for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      } {
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      } int sum = 0; sum 0 int x = i; x i while(x != 0){
        	sum += x%10;
            x = x/10;
        } x != 0 x 0 {
        	sum += x%10;
            x = x/10;
        } sum += x%10 sum x%10 x 10 x = x/10 x x/10 x 10 if(a <= sum&&sum <= b)re += i; a <= sum&&sum <= b a <= sum a sum sum <= b sum b re += i re i sum = 0 sum 0 System.out.println(re) System.out.println System.out System System.out re String[] args args public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    }
} public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    }
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      int re = 0;
      for(int i = 1;i <= n;i++){
        int sum = 0;
        int x = i;
        while(x != 0){
        	sum += x%10;
            x = x/10;
        }
        if(a <= sum&&sum <= b)re += i;
        sum = 0;
      }
      System.out.println(re);
    }
}