#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0);cin.tie(0)
#define endl '\n'
#define MAXN maxn

using namespace std;

int N, A, B;
int t, sum, res;

signed main()
{
  IO;
  cin >> N >> A >> B;
  for (int i = 1; i <= N; i++) {
    t = i;
    sum = 0;
    while (t) {
      sum += t % 10;
      t /= 10;
    }
    if (A <= sum && sum <= B) {
      res += i;
    }
  }
  cout << res << endl;
  return 0;
}

