#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
long long F(long long x) {
  if (x < 10) {
    return x;
  }
  long long tmpx = x;
  long long last = x % 10;
  long long first = 0;
  while (x) {
    first = x % 10;
    x /= 10;
  }
  if (first <= last) {
    return 9 + tmpx / 10;
  } else {
    return 8 + tmpx / 10;
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long a;
  long long b;
  cin >> a >> b;
  cout << F(b) - F(a - 1) << endl;
  return 0;
}
