#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r, sum, nl, nr, suml, sumr;
  while (~scanf("%I64d%I64d", &l, &r)) {
    if (l >= 10) {
      suml = l / 10 + 8;
      nl = l;
      while (nl >= 10) nl /= 10;
      for (int i = 0; i <= l % 10 - 1; i++)
        if (i == nl) suml++;
    } else
      suml = l - 1;
    if (r >= 10) {
      sumr = r / 10 + 8;
      nr = r;
      while (nr >= 10) nr /= 10;
      for (int i = 0; i <= r % 10; i++)
        if (i == nr) sumr++;
    } else
      sumr = r;
    sum = sumr - suml;
    cout << sum << endl;
  }
  return 0;
}
