#include <bits/stdc++.h>
using namespace std;
long long l, r;
unsigned long long tens[20];
vector<int> getv(long long n) {
  vector<int> v;
  v.resize(0);
  while (n) {
    v.push_back(n % 10);
    n /= 10;
  }
  reverse(v.begin(), v.end());
  return v;
}
int deg(long long n) {
  int i;
  for (i = 0; tens[i] <= n; i++)
    ;
  return i - 1;
}
long long fun(long long n) {
  if (n <= 0) return 0;
  if (n < 10) return n;
  long long ans = 0;
  vector<int> v = getv(n);
  int m = deg(n);
  ans += (9 + tens[m - 1] - 1);
  ans += (v[0] - 1) * tens[m - 1];
  for (int i = 1; i <= m - 1; i++) ans += v[i] * tens[m - i - 1];
  ans += (v[m] >= v[0]);
  return ans;
}
int main() {
  cin >> l >> r;
  tens[0] = 1;
  for (int i = 1; i <= 19; i++) tens[i] = 10 * tens[i - 1];
  cout << (fun(r) - fun(l - 1));
  return 0;
}
