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