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