#include <bits/stdc++.h>
using namespace std;
long long l, r, p[100];
long long calc(long long r) {
  if (r < 10) return r;
  long long k = r;
  int len = 0;
  while (k) {
    len++;
    k /= 10;
  }
  return r / 10 + 9 - (r % 10 < r / p[len - 1]);
}
int main() {
  cin >> l >> r;
  p[0] = 1;
  for (int i = 1; i <= 18; ++i) p[i] = p[i - 1] * 10ll;
  cout << calc(r) - calc(l - 1);
  return 0;
}
