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