#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
long long howmany(long long x) {
  if (x == 0) return 0;
  int xc = 0;
  long long temp = x;
  int xstart = x % 10, xlast;
  long long res = 0;
  while (temp) {
    xlast = temp % 10;
    temp /= 10;
    xc++;
  }
  if (xc == 1) {
    return x;
  }
  long long c = 1;
  for (int i = 0; i < xc - 2; i++) {
    c *= 10;
  }
  res += c + 8;
  temp = x;
  long long hoge = (temp - xstart) / 10 - c * xlast;
  if (xlast <= xstart) hoge++;
  res += hoge;
  res += c * (xlast - 1);
  return res;
}
int main() {
  int n;
  long long l, r;
  cin >> l >> r;
  l--;
  cout << howmany(r) - howmany(l) << endl;
  return 0;
}
