#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 7;
const double EPS = 1e-9;
int bit_count(int x) { return x == 0 ? 0 : 1 + bit_count(x & (x - 1)); }
inline int low_bit(int x) { return x & -x; }
inline int sign(double x) { return x < -EPS ? -1 : x > EPS ? 1 : 0; }
inline int sign(int x) { return (x > 0) - (x < 0); }
template <class T>
void chmin(T &t, T f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, T f) {
  if (t < f) t = f;
}
int gcd(int a, int b) {
  while (b) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int nextComb(int x) {
  int smallest = x & -x;
  int ripple = x + smallest;
  int ones = x ^ ripple;
  ones = (ones >> 2) / smallest;
  return ripple | ones;
}
inline int getint() {
  int a;
  return scanf("%d", &a) ? a : (fprintf(stderr, "trying to read\n"), -1);
}
inline double getdouble() {
  double a;
  return scanf("%lf", &a) ? a : (fprintf(stderr, "trying to read\n"), -1.0);
}
long long last(long long x) { return x % 10; }
long long first(long long x) {
  while (x >= 10) x /= 10;
  return x;
}
long long pos(long long x) {
  if (x < 10)
    return x;
  else
    return 8 + x / 10 + (last(x) >= first(x));
}
void myCode() {
  long long x, y;
  cin >> x >> y;
  cout << (pos(y) - pos(x - 1)) << endl;
}
int main() {
  srand(time(NULL));
  myCode();
  return 0;
}
