#include <bits/stdc++.h>
using namespace std;
bool ar[200000020] = {false};
int ar2[2000000];
int a[10][10];
char c[10][10] = {'1'};
pair<int, int> p[200000];
string str[110];
int min(int x, int y, int z) {
  int miin = x;
  if (miin < y) miin = y;
  if (miin < z) miin = z;
  return miin;
}
int main() {
  long long int a, b;
  long long int q;
  long long int f;
  cin >> a >> b;
  long long int k;
  k = a - 1;
  if (k >= 10) {
    q = k / 10 + 9;
    f = k;
    while (f >= 10) {
      f /= 10;
    }
    if (f > (k % 10)) q--;
  } else
    q = a - 1;
  long long int temp = q;
  k = b;
  if (k >= 10) {
    q = k / 10 + 9;
    f = k;
    while (f >= 10) {
      f /= 10;
    }
    if (f > (k % 10)) q--;
  } else
    q = b;
  cout << q - temp;
  return 0;
}
