#include <bits/stdc++.h>
using namespace std;
long long solve(long long num) {
  long long s = 0, ans = 0, temp, i, j;
  vector<int> v;
  if (num == 0) {
    ++s;
    v.push_back(0);
  }
  while (num != 0) {
    ++s;
    v.push_back((num % 10));
    num /= 10;
  }
  reverse(v.begin(), v.end());
  for (i = 1; i <= s; ++i) {
    temp = 9;
    if (i == 1) temp = 10;
    for (j = 2; j < i; ++j) temp *= (long long)10;
    ans += temp;
  }
  temp = 9 - v[0];
  for (i = 1; i < ((long long)(v.size()) - 1); ++i)
    temp = temp * 10 + (9 - v[i]);
  if (v[0] > v[(long long)(v.size()) - 1]) ++temp;
  ans = ans - temp;
  return ans;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long l, r, i;
  cin >> l >> r;
  cout << (solve(r) - solve(l - 1));
  return 0;
}
