#include <bits/stdc++.h>
using namespace std;
bool ok(long long x) {
  int t;
  t = x % 10;
  while (x >= 10) {
    x /= (long long)10;
  }
  return (t == x);
}
int main() {
  long long l, r, ans, i;
  cin >> l >> r;
  ans = 0;
  while (l <= r && ok(l)) {
    l++;
    ans++;
  }
  while (l <= r && ok(r)) {
    r--;
    ans++;
  }
  if ((long long)r - l <= 100) {
    for (i = l; i <= r; i = i + 1)
      if (ok(i)) ans++;
    cout << ans << endl;
    return 0;
  }
  while (l % 10 != 0) {
    if (ok(l)) ans++;
    l++;
  }
  while (r % 10 != 9) {
    if (ok(r)) ans++;
    r--;
  }
  ans += (long long)(r - l + 1) / 10;
  cout << ans << endl;
  return 0;
}
