#include <bits/stdc++.h>
using namespace std;
long long calc(long long x) {
  if (x < 10) return x;
  long long y = x, ld = x % 10;
  while (y >= 10) y /= 10;
  long long ret = x / 10 + 9;
  if (y > ld) ret--;
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  long long a, b;
  cin >> a >> b;
  cout << calc(b) - calc(a - 1) << endl;
  return 0;
}
