#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e5;
long long f(long long a) {
  if (a < 10) return a;
  vector<int> digs;
  while (a) digs.push_back(a % 10), a /= 10;
  reverse(digs.begin(), digs.end());
  int s = digs.size();
  long long res = 9, tmp = 1;
  for (int i = 0; i < s - 2; ++i) {
    res += 9 * tmp;
    tmp *= 10;
  }
  for (int i = 0; i < s - 1; ++i) {
    res += (digs[i] - (i == 0)) * tmp;
    tmp /= 10;
  }
  if (digs[0] <= digs.back()) res++;
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long l, r;
  cin >> l >> r;
  cout << f(r) - f(l - 1);
}
