#include <iostream>
using namespace std;
int sumOfDigits(int a){
int sum = 0;
while (a > 0){
sum += a%10;
a /= 10;
}
return sum;
}
int main() {
int m, n, sumMin, counter = 1;
cin >> m >> n;
sumMin = sumOfDigits(m);
for(int i = m + 1; i <= n; i++){
if (sumOfDigits(i) < sumMin){
sumMin = sumOfDigits(i);
counter = 1;
}
else if (sumOfDigits(i) == sumMin)
counter++;
}
cout << counter;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IHN1bU9mRGlnaXRzKGludCBhKXsKCWludCBzdW0gPSAwOwoJd2hpbGUgKGEgPiAwKXsKCQlzdW0gKz0gYSUxMDsKCQlhIC89IDEwOwoJfQoJcmV0dXJuIHN1bTsKfQoKaW50IG1haW4oKSB7CglpbnQgbSwgbiwgc3VtTWluLCBjb3VudGVyID0gMTsKCWNpbiA+PiBtID4+IG47CglzdW1NaW4gPSBzdW1PZkRpZ2l0cyhtKTsKCWZvcihpbnQgaSA9IG0gKyAxOyBpIDw9IG47IGkrKyl7CgkJaWYgKHN1bU9mRGlnaXRzKGkpIDwgc3VtTWluKXsKCQkJc3VtTWluID0gc3VtT2ZEaWdpdHMoaSk7CgkJCWNvdW50ZXIgPSAxOwoJCQl9CgkJZWxzZSBpZiAoc3VtT2ZEaWdpdHMoaSkgPT0gc3VtTWluKSAgIAoJCWNvdW50ZXIrKzsKCQl9Cgljb3V0IDw8IGNvdW50ZXI7CglyZXR1cm4gMDsKfQ==