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 digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 }
} 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 digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 }
} 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 digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 } main {
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int A = sc.nextInt();
   int B = sc.nextInt();
   
   int digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 } 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 digitsum = 0; digitsum 0 int tmp; tmp int ans = 0; ans 0 for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   } int k = 1; int k = 1; k 1 k<=N k N k++ k++ k {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   } {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   } digitsum=0 digitsum 0 tmp = k tmp k for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    } int i = 0; int i = 0; i 0 i<6 i 6 i++ i++ i {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    } {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    } digitsum += tmp%10 digitsum tmp%10 tmp 10 tmp = tmp/10 tmp tmp/10 tmp 10 if(tmp==0) break; tmp==0 tmp 0 break; if(digitsum>=A&&digitsum<=B) ans+=k; digitsum>=A&&digitsum<=B digitsum>=A digitsum A digitsum<=B digitsum B ans+=k ans k System.out.println(ans) System.out.println System.out System System.out ans 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 digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 }
} 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 digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 }
} 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 digitsum = 0;
   int tmp;
   int ans = 0;
   for(int k = 1;k<=N;k++)
   {
    digitsum=0;
    tmp = k;
    for(int i = 0;i<6;i++)
    {
      digitsum += tmp%10;
      tmp = tmp/10;
      if(tmp==0) break;
    }
    if(digitsum>=A&&digitsum<=B) ans+=k;
   }
   System.out.println(ans);
 }
}