#include <bits/stdc++.h>
using namespace std;
int first(long long n) {
  while (n >= 10) {
    n /= 10;
  }
  return n;
}
int main() {
  long long l, r;
  long long newl, newr;
  cin >> l >> r;
  long long count = 0;
  newl = l + 10 - l % 10;
  newr = r - r % 10;
  if (newr > newl) {
    count = (newr - newl) / 10;
    for (long long i = l; i < min(newl, r); ++i) {
      if (first(i) == i % 10) {
        ++count;
      }
    }
    for (long long i = max(newr + 1, l); i <= r; ++i) {
      if (first(i) == i % 10) {
        ++count;
      }
    }
  } else {
    for (long long i = l; i <= r; ++i) {
      if (first(i) == i % 10) {
        ++count;
      }
    }
  }
  cout << count << endl;
}
