#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"n,a,b=map(int,input().split());c=0\n"
"while n:c+=n*(a<=sum(map(int,str(n)))<=b);n-=1\n"
"print(c)\n"
"\"";
  system(s);
  return 0;
}            