#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int now = 0;
    string s;
    s = to_string(i);
    for (int j = 0; j < int(s.size()); j++) now += s[j] - '0';
    if (a <= now && now <= b) ans += i;
  }
  cout << ans << endl;
  return 0;
}
