#include <bits/stdc++.h>
using namespace std;
int v[20];
long long int d[20];
long long int memo[20][2][11];
long long int solve(int ind, int n, int f, int p) {
  if (ind == n - 1) {
    if (f == 1 && p > v[ind]) return 0;
    return 1;
  }
  long long int res = 0;
  if (memo[ind][f][p] != -1) return memo[ind][f][p];
  int nf = f;
  for (int i = 0; i <= 9; i++) {
    nf = f;
    if (i == 0 && ind == 0) continue;
    if (f == 1 && i > v[ind]) break;
    if (f == 1 && i < v[ind]) nf = 0;
    if (ind == 0)
      res += solve(ind + 1, n, nf, i);
    else
      res += solve(ind + 1, n, nf, p);
  }
  return memo[ind][f][p] = res;
}
int conta(long long int x) {
  int res = 0;
  while (x != 0) {
    v[res++] = x % 10;
    x = x / 10;
  }
  reverse(v, v + res);
  return res;
}
long long int calcula(long long int x) {
  int n = conta(x);
  if (n == 0) return 0;
  if (n == 1) return x;
  long long int res = 0;
  for (int i = 1; i <= n - 1; i++) {
    res += d[i];
  }
  memset(memo, -1, sizeof(memo));
  res += solve(0, n, 1, 0);
  return res;
}
int main() {
  d[1] = 9;
  long long int pot = 1;
  for (int i = 0; i < 18; i++) {
    d[i + 2] = 9 * pot;
    pot = pot * 10;
  }
  long long int a, b;
  scanf("%lld %lld", &a, &b);
  long long int res = calcula(b) - calcula(a - 1);
  printf("%lld\n", res);
  return 0;
}
