#include <bits/stdc++.h>
using namespace std;
inline long long getBit(long long n) {
  int b = 0;
  while (n) {
    b++;
    n /= 10;
  }
  return b;
}
inline long long getp(long long n) {
  while (n >= 10) {
    n /= 10;
  }
  return n;
}
int main() {
  long long l, r;
  while (cin >> l >> r) {
    long long ans = 0;
    long long ll = getBit(l), rr = getBit(r);
    if (ll == 1 || ll == 0) {
      if (rr == 1)
        ans = r - l + 1;
      else {
        ans += (9 - l) + 1;
        long long pp = r / 10;
        if (r % 10 < getp(r)) pp--;
        ans += pp;
      }
    } else {
      long long a = l / 10;
      long long b = r / 10;
      if (l % 10 > getp(l)) a++;
      if (r % 10 < getp(r)) b--;
      ans = b - a + 1;
    }
    cout << ans << endl;
  }
}
