#include <bits/stdc++.h>
using namespace std;
long long L, R;
long long count(long long x) {
  if (x < 10) return x;
  long long ret = (x - 10) / 10 + 9;
  long long tp = x % 10;
  while (x >= 10) x /= 10;
  if (x <= tp) ret++;
  return ret;
}
int main() {
  int i, j;
  while (cin >> L >> R) {
    cout << count(R) - count(L - 1) << endl;
  }
  return 0;
}
