#include <bits/stdc++.h>
using namespace std;
long long int pten(long long int n) {
  long long int ret = 1, sq = 10;
  while (n) {
    if (n & 1) ret *= sq;
    n >>= 1;
    sq = sq * sq;
  }
  return ret;
}
long long int d(long long int num) {
  long long int ret = 0;
  while (num) {
    num /= 10;
    ++ret;
  }
  return ret;
}
int main() {
  string x, y;
  cin >> x >> y;
  long long int dr = y.length(), dl = x.length(), lx = 20, ly = 20, cx[lx],
                cy[ly];
  if (dr == 1) {
    cout << y[0] - x[0] + 1;
    putchar('\n');
    return 0;
  }
  for (int i = dl - 1; i + 1; cx[lx--] = x[i] - '0', --i)
    ;
  ++lx;
  for (int i = dr - 1; i + 1; cy[ly--] = y[i] - '0', --i)
    ;
  ++ly;
  long long int ans = 0;
  ans += pten(dr - 2) - pten(dl - 1);
  if (dl == 1)
    ans += 10 - cx[lx];
  else {
    int k = 9 - cx[lx];
    ans += k * pten(dl - 2);
    for (int i = lx + 1; i < 20; ++i) {
      ans += (9 - cx[i]) * pten(19 - i);
    }
    ans += (cx[lx] >= cx[20]);
  }
  int k = cy[ly] - 1;
  ans += k * pten(dr - 2);
  for (int i = ly + 1; i < 20; ++i) {
    ans += cy[i] * pten(19 - i);
  }
  ans += (cy[ly] <= cy[20]);
  printf("%I64d", ans);
  putchar('\n');
  return 0;
}
