#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  if (n < 10) return n;
  long long last_digit = n % 10;
  long long ret = n / 10 + 9;
  long long tmp = n;
  while (tmp >= 10) tmp = tmp / 10;
  if (tmp > last_digit) ret--;
  return ret;
}
int main() {
  long long i, j, k, n, m, d, a, b;
  while (cin >> a >> b) {
    cout << f(b) - f(a - 1) << "\n";
  }
  return 0;
}
