//
//  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 main() {
    int N, A, B;
    cin >> N >> A >> B;
    long long ans = 0;
    for (int i=1; i<=N; i++){
        // calculate sum of digits
        int x = i;
        int sum = 0;
        while (x >= 10){
            sum += x % 10;
            x /= 10;
        }
        sum += x;
        
        if (sum >= A && sum <= B){
            ans += i;
        }
    }
    cout << ans << '\n';
    return 0;
}
