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