#include <bits/stdc++.h>
using namespace std;
long long first(long long x) {
  while (x >= 10) x /= 10;
  return x;
}
long long getCount(long long x) {
  if (x < 10) return x;
  long long tens = x / 10;
  long long res = tens + 9;
  long long firstDigit = first(x);
  long long lastDigit = x % 10;
  if (lastDigit < firstDigit) res--;
  return res;
}
long long getCountcall(long long start, long long end) {
  return getCount(end) - getCount(start - 1);
}
int main() {
  long long start, end;
  cin >> start >> end;
  cout << getCountcall(start, end);
  return 0;
}
