#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  long long r = 0;
  if (n < 10) return n;
  r = n / 10 + 8;
  long long temp = n;
  while (n > 9) n /= 10;
  if (temp % 10 >= n) r++;
  return r;
}
int main() {
  long long n, m;
  cin >> n >> m;
  cout << f(m) - f(n - 1) << endl;
}
