#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long inf = ~0ull >> 1;
int f(long long x) {
  while (x / 10) {
    x /= 10;
  }
  return x;
}
int w(long long x) {
  int ans = 0;
  while (x) {
    x /= 10;
    ans++;
  }
  return ans;
}
long long cnt[20][10];
int main() {
  for (int i = 1; i <= 18; ++i) {
    for (int j = 1; j <= 9; ++j) {
      if (j == 1) {
        cnt[i][j] = cnt[i - 1][9] + (long long)pow(10, max(0, i - 2));
      } else
        cnt[i][j] = cnt[i][j - 1] + (long long)pow(10, max(0, i - 2));
    }
  }
  ios::sync_with_stdio(0), cin.tie(0);
  long long l, r;
  cin >> l >> r;
  int lw = w(l), rw = w(r);
  int fl = f(l), fr = f(r);
  long long x = cnt[lw][fl - 1], y = cnt[rw][fr - 1];
  if (fl == 1) x = cnt[lw - 1][9];
  if (fr == 1) y = cnt[rw - 1][9];
  x += max(1ll, (l / 10 - fl * max(10ll, (long long)pow(10, lw - 2))) + 1);
  y += max(1ll, (r / 10 - fr * max(10ll, (long long)pow(10, rw - 2))) + 1);
  if (fl > l % 10) x--;
  if (fr > r % 10) y--;
  long long ans = y - x;
  if (fl == l % 10) ans++;
  cout << ans << endl;
  return 0;
}
