#include <bits/stdc++.h>
using namespace std;
int ln(long long int x) {
  int ans = 0;
  while (x) {
    x /= 10;
    ans++;
  }
  return ans;
}
long long int p[100];
long long int f(long long int x) {
  int l = ln(x);
  long long int ans = 0;
  if (l > 1) ans += ((x / p[l - 1]) - 1) * p[l - 2];
  if (x % 10 >= x / p[l - 1]) ans++;
  x = x % p[l - 1];
  return ans + x / 10;
}
int main() {
  p[0] = 1;
  for (int i = 1; i < 100; i++) p[i] = p[i - 1] * 10;
  long long int a, b;
  cin >> a >> b;
  long long int ans = 0;
  if (b < 10) {
    cout << b - a + 1 << endl;
    return 0;
  }
  if (a < 10) {
    ans += 10 - a;
    a = 10;
  }
  for (int i = ln(a); i < ln(b); i++) ans += 9 * p[i - 2];
  ans += f(b);
  ans -= f(a);
  if (a / p[ln(a) - 1] == a % 10) ans++;
  cout << ans << endl;
  return 0;
}
