read n a b
ans=0
for (( k = 1; k <= n; k++ )); do
    dsum=0
    for (( j = 0; j < ${#k}; j++ )); do
        (( dsum += ${k:j:1} ))
    done
    if (( dsum >= a && dsum <= b )); then
        (( ans += k ))
    fi
done
echo ${ans}