import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	}

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	}

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	} main {
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = getInputInteger(sc); n getInputInteger(sc) getInputInteger sc int a = getInputInteger(sc); a getInputInteger(sc) getInputInteger sc int b = getInputInteger(sc); b getInputInteger(sc) getInputInteger sc int sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        } {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        } int[] ds = toIntegerList(String.valueOf(i)); ds toIntegerList(String.valueOf(i)) toIntegerList String.valueOf(i) String.valueOf String i int dsum = 0; dsum 0 for (int v : ds) {
                dsum += v;
            } int v ds {
                dsum += v;
            } {
                dsum += v;
            } dsum += v dsum v if (a <= dsum && dsum <= b) {
                sum += i;
            } a <= dsum && dsum <= b a <= dsum a dsum dsum <= b dsum b {
                sum += i;
            } sum += i sum i output(String.valueOf(sum)) output String.valueOf(sum) String.valueOf String sum String[] args args public static String getInputString(Scanner sc) {
		return sc.next();
	} getInputString {
		return sc.next();
	} return sc.next(); sc.next() sc.next sc Scanner sc sc public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	} getInputInteger {
		return Integer.parseInt(sc.next());
	} return Integer.parseInt(sc.next()); Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Scanner sc sc public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	} output {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	} boolean isInit = true; isInit true String str = ""; str "" for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		} String s params {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		} {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		} if (!isInit) {
				str += " ";
			} !isInit isInit {
				str += " ";
			} str += " " str " " str += s str s isInit = false isInit false System.out.println(str) System.out.println System.out System System.out str String... params params public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    } toIntegerList {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    } int[] ret = new int[s.length()]; ret new int[s.length()] s.length() s.length s for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        } {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        } ret[i] = Integer.parseInt(String.valueOf(s.charAt(i))) ret[i] ret i Integer.parseInt(String.valueOf(s.charAt(i))) Integer.parseInt Integer String.valueOf(s.charAt(i)) String.valueOf String s.charAt(i) s.charAt s i return ret; ret String s s public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	}

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	}

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = getInputInteger(sc);
		int a = getInputInteger(sc);
		int b = getInputInteger(sc);
 
        // programming
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int[] ds = toIntegerList(String.valueOf(i));
            int dsum = 0;
            for (int v : ds) {
                dsum += v;
            }
            if (a <= dsum && dsum <= b) {
                sum += i;
            }
        }
        output(String.valueOf(sum));
	}

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }
}