#include <bits/stdc++.h>
using namespace std;
const long long inf = 1 << 28;
char arr[22];
long long len;
long long dp[20][2][2][2];
long long solve(long long indx, long long flag, long long bos, long long conf) {
  long long &ret = dp[indx][flag][bos][conf];
  if (ret != -1) return ret;
  if (indx == len - 1 && len != 1) {
    if (bos == 1) return !conf;
    return 10;
  }
  if (indx == len) return ret = 1;
  long long i, lim = arr[indx] - '0';
  if (!flag) lim = 9;
  ret = 0;
  for (i = 0; i < lim; i++) {
    if (i != 0)
      ret += solve(indx + 1, 0, 1, 0);
    else
      ret += solve(indx + 1, 0, bos, 0);
  }
  if (indx == 0) {
    if (lim <= arr[len - 1] - '0')
      ret += solve(indx + 1, flag, 1, 0);
    else
      ret += solve(indx + 1, flag, 1, 1);
  } else
    ret += solve(indx + 1, flag, 1, conf);
  return ret;
}
int main() {
  long long a, b;
  while (cin >> a >> b) {
    --a;
    sprintf(arr, "%I64d", a);
    len = strlen(arr);
    memset(dp, -1, sizeof(dp));
    a = solve(0, 1, 0, 1);
    sprintf(arr, "%I64d", b);
    len = strlen(arr);
    memset(dp, -1, sizeof(dp));
    b = solve(0, 1, 0, 1);
    cout << b - a << endl;
  }
  return 0;
}
