#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  if (n < 10) return n;
  string s = "";
  long long m = n;
  while (n > 0) {
    s = char(n % 10 + int('0')) + s;
    n /= 10;
  }
  long long res = m / 10 - 1;
  if (s[0] <= s[int(s.size()) - 1]) ++res;
  res += 9;
  return res;
}
int main() {
  long long l, r;
  cin >> l >> r;
  cout << f(r) - f(l - 1);
  return 0;
}
