#include <bits/stdc++.h>
using namespace std;
long long int calc(long long int a) {
  if (a < 10) return a;
  int ld = a % 10;
  long long int res = 9 + (a - 10) / 10;
  while (a > 9) a /= 10;
  if (ld >= a) ++res;
  return res;
}
int main() {
  long long int a, b;
  cin >> a >> b;
  cout << calc(b) - calc(a - 1) << endl;
  return 0;
}
