#include <bits/stdc++.h>
using namespace std;
long long bt_cnt(long long n) {
  long long cnt = 0;
  while (n != 0) {
    cnt++;
    n /= 10;
  }
  return cnt;
}
long long msb(long long n) {
  long long hold = 0;
  while (n != 0) {
    hold = n % 10;
    n /= 10;
  }
  return hold;
}
long long solve(long long n) {
  if (n == 0) return 0;
  long long ans = 0;
  long long bno = bt_cnt(n);
  long long las = msb(n);
  if (n <= 9) return n;
  ans += pow((long long)10, bno - 2) * las + 8;
  long long temp1 = n - pow((long long)10, bno - 1) * las;
  temp1 -= las - 1;
  temp1 = ceil((long double)temp1 / 10);
  ans += max(temp1, (long long)0);
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long l, r;
  cin >> l >> r;
  long long ans = solve(r);
  ans -= solve(l - 1);
  cout << ans;
  return 0;
}
