#include <bits/stdc++.h>
using namespace std;
int coun(long long x) {
  int count = 0;
  while (x) {
    x /= 10;
    count++;
  }
  return count;
}
int main() {
  long long int l, r;
  cin >> l >> r;
  long long m1 = 1;
  long long m2 = 1;
  int x = coun(l);
  for (int i = 1; i < x; i++) m1 *= 10;
  int y = coun(r);
  for (int i = 1; i < y; i++) m2 *= 10;
  long long count = 0;
  if (x >= 2)
    for (int i = 1; i < l / m1; i++) count += (x < 2) ? (1) : (m1 / 10);
  long long count2 = (x < 2) ? (l - 1) : (l % m1) / 10;
  if (x >= 2 && l % 10 > (l / m1)) count2++;
  count += count2;
  count = ((x < 2) ? (9) : (m1 / 10 * 9)) - count;
  x++;
  m1 *= 10;
  while (x <= y) {
    count += (m1 / 10 * 9);
    m1 *= 10;
    x++;
  }
  long long int count3 = 0;
  if (y >= 2)
    for (int i = r / m2 + 1; i <= 9; i++) count3 += m2 / 10;
  count3 += (y < 2) ? (9 - r) : ((r / m2 + 1) * m2 / 10 - (r / 10));
  if (y >= 2 && r % 10 >= (r / m2)) count3--;
  count -= count3;
  cout << count << endl;
  return 0;
}
