import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)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 m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)count+=i;
  }
  System.out.println(count);
}
} Main public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)count+=i;
  }
  System.out.println(count);
} main {
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)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 m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int count=0; count 0 for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)count+=i;
  } int i=0; int i=0; i 0 i<=n i n i++ i++ i {
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)count+=i;
  } {
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)count+=i;
  } String po=i+""; po i+"" i "" String[]popo=po.split("",0); popo po.split("",0) po.split po "" 0 int p=0; p 0 for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]); int j=0; int j=0; j 0 j<popo.length j popo.length popo popo.length j++ j++ j p+=Integer.parseInt(popo[j]); p+=Integer.parseInt(popo[j]) p Integer.parseInt(popo[j]) Integer.parseInt Integer popo[j] popo j if(m<=p&&p<=a)count+=i; m<=p&&p<=a m<=p m p p<=a p a 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 m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)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 m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)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 m=sc.nextInt();int a=sc.nextInt();
  int count=0;
  for(int i=0;i<=n;i++){
  	String po=i+"";
    String[]popo=po.split("",0);
    int p=0;
    for(int j=0;j<popo.length;j++)p+=Integer.parseInt(popo[j]);
    if(m<=p&&p<=a)count+=i;
  }
  System.out.println(count);
}
}
