//
//  main.cpp
//  pE E - Some Sums
//
//  Created by Hsiu-Fen Chou on 2019/12/20.
//  Copyright © 2019 Hsiu-Fen Chou. All rights reserved.
//

#include <iostream>
using namespace std;

int sumOfDigits(int x){
    int ret = 0;
    while (x >= 10){
        ret += x % 10;
        x /= 10;
    }
    ret += x;
    return ret;
}

int main() {
    int N, A, B;
    int sum = 0;
    cin >> N >> A >> B;
    for (int i=1; i<=N; i++){
        int tmp = sumOfDigits(i);
        if (tmp >= A && tmp <= B){
            sum += i;
        }
    }
    cout << sum << '\n';
    return 0;
}
