#include <bits/stdc++.h>
using namespace std;
int first(long long n) {
  while (n >= 10) n /= 10;
  return n;
}
long long f(long long n) {
  if (n < 10) return n;
  int k = first(n);
  return n / 10 + 9 - (k > n % 10 ? 1 : 0);
}
int main() {
  long long l, r;
  cin >> l >> r;
  cout << f(r) - f(l - 1) << endl;
  return 0;
}
