import java.util.Scanner;
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 ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	System.out.println(ans);
      }
} import java.util.Scanner; Scanner 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 ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	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 ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	System.out.println(ans);
      } main {
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();

    int ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	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 ans = 0; ans 0 for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    } {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    } if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    } i<=9 i 9 {
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	} if(a<=i && i<=b) {
    		    ans += i;
    	        } a<=i && i<=b a<=i a i i<=b i b {
    		    ans += i;
    	        } ans += i ans i if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    } i<=99 i 99 {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	} if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			} a <= i/10 + i%10 && i/10 + i%10 <= b a <= i/10 + i%10 a i/10 + i%10 i/10 i 10 i%10 i 10 i/10 + i%10 <= b i/10 + i%10 i/10 i 10 i%10 i 10 b {
    			ans += i;   				
    			} ans += i ans i if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    } i<=999 i 999 {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        } if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		} a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b a <= i/100 + (i%100)/10 + (i%10) a i/100 + (i%100)/10 + (i%10) i/100 + (i%100)/10 + (i%10) i/100 i 100 (i%100)/10 (i%100) i 100 10 (i%10) i 10 i/100 + (i%100)/10 + (i%10) <= b i/100 + (i%100)/10 + (i%10) i/100 + (i%100)/10 + (i%10) i/100 i 100 (i%100)/10 (i%100) i 100 10 (i%10) i 10 b {
      			ans += i;
      		} ans += i ans i if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    } i<=9999 i 9999 {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	} if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		} a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) a i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) ((i%1000)%100)/10 i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) i/1000 i 1000 (i%1000)/100 (i%1000) i 1000 100 ((i%1000)%100)/10 ((i%1000)%100) (i%1000) i 1000 100 10 (i%10) i 10 i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) ((i%1000)%100)/10 i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) i/1000 i 1000 (i%1000)/100 (i%1000) i 1000 100 ((i%1000)%100)/10 ((i%1000)%100) (i%1000) i 1000 100 10 (i%10) i 10 b {
      			ans += i;
      		} ans += i ans i if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    } i== 10000 i 10000 {
    		if(a==1) {
    			ans += i;
    	}
    } if(a==1) {
    			ans += i;
    	} a==1 a 1 {
    			ans += i;
    	} ans += i ans i 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 ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	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 ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	System.out.println(ans);
      }
} Main
import java.util.Scanner;
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 ans = 0;
    for(int i=1; i<=n; i++) {
    	if(i<=9){
    	    if(a<=i && i<=b) {
    		    ans += i;
    	        }
    	}else if(i<=99) {
    		if(a <= i/10 + i%10 && i/10 + i%10 <= b) {
    			ans += i;   				
    			}
      	}else if(i<=999) {
      		if(a <= i/100 + (i%100)/10 + (i%10) && i/100 + (i%100)/10 + (i%10) <= b) {
      			ans += i;
      		}
        }else if(i<=9999) {
      		if (a <= i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10) && i/1000 + (i%1000)/100 + ((i%1000)%100)/10 +(i%10)<= b) {
      			ans += i;
      		}
      	}else if(i== 10000){
    		if(a==1) {
    			ans += i;
    	}
    }
    }
        	System.out.println(ans);
      }
}