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