#include <bits/stdc++.h>
using namespace std;
int ragham1(long long n) {
  while (n >= 10) n /= 10;
  return n;
}
long long tabe(long long n) {
  long long ans = 8;
  ans += n / 10;
  if (ragham1(n) <= n % 10) ans++;
  return ans;
}
int main() {
  long long l, r;
  cin >> l >> r;
  if (l < 10) {
    if (r < 10)
      cout << r - l + 1 << endl;
    else
      cout << tabe(r) - l + 1 << endl;
  } else if (ragham1(l) == l % 10)
    cout << tabe(r) - tabe(l) + 1 << endl;
  else
    cout << tabe(r) - tabe(l) << endl;
  return 0;
}
