read n a b
ans=0
for (( k = 1; k <= n; k++ )); do
    dsum=0 k1=$k
    while (( k1 > 0 )); do
        dsum=$(( dsum + k1 % 10 )) k1=$(( k1 / 10 ))
    done
    (( dsum >= a && dsum <= b )) && (( ans += k ))
done
echo ${ans}