#include <stdio.h>

int main() {
    int n, a, b, sum = 0;
    scanf("%d%d%d", &n, &a, &b);

    for (int i = 0, s; i <= n; i++) {
        s = 0;
        for (int j = i; j > 0; j /= 10)
            s += j % 10;
        if (s >= a && s <= b)
            sum += i;
    }

    printf("%d", sum);

    return 0;
}