#include <bits/stdc++.h>
const unsigned long long P = 239017, maxn = 2100000, INF = 100000000;
using namespace std;
bool f, z;
unsigned long long step(int a, int x) {
  unsigned long long b = 1;
  while (x != 0) b *= a, --x;
  return b;
}
unsigned long long l, r;
int add;
unsigned long long get_ans(unsigned long long a) {
  if (a == 0 && !z) return 1;
  if (a == 0 && z) return 0;
  int n = 0;
  unsigned long long a1 = a, b = 0;
  while (a1 > 0) a1 /= 10, ++n;
  if (n == 1) return a + 1;
  unsigned long long fr = a / step(10, n - 1);
  b = 10;
  int k = 1;
  unsigned long long mn = 9;
  while (k + 1 < n) {
    b += mn;
    mn *= 10;
    ++k;
  }
  for (int i = 1; i < fr; ++i) b += step(10, n - 2);
  if (n > 2) {
    b += (a % step(10, n - 1)) / 10;
  }
  if (fr <= a % 10) ++b;
  return b;
}
int main() {
  scanf("%I64d%I64d", &l, &r);
  if (l == 0 && r == 0) {
    printf("1");
    return 0;
  }
  if (l == 0) z = true;
  if (l > 0) l -= 1;
  if (l == r) f = true;
  printf("%I64d", get_ans(r) - get_ans(l));
  return 0;
}
