#include <bits/stdc++.h>
using namespace std;
long long getfirst(long long a) {
  while (a > 9) a /= 10;
  return a;
}
long long getlast(long long a) { return a % 10; }
int main() {
  long long l, r;
  cin >> l >> r;
  long long count = 0;
  for (long long i = l; i <= r; i++) {
    if (i < 10) {
      count++;
      continue;
    }
    if (i < 100) {
      if (getfirst(i) == getlast(i)) {
        count++;
        continue;
      }
    }
    if (getfirst(i) != getlast(i)) continue;
    long long zzz = 1000000000000000000;
    while (zzz + i > r || zzz > i || getfirst(i) != getfirst(i + zzz))
      zzz /= 10;
    if (zzz >= 10) {
      count += zzz / 10;
      i += zzz - 1;
      continue;
    }
    if (getfirst(i) == getlast(i)) count++;
  }
  cout << count << endl;
  return 0;
}
