#include <bits/stdc++.h>
using namespace std;
long long int p[20];
long long int getUpTo(string a, int &inc) {
  long long int answ = 0;
  if (a.size() == 1) {
    inc = 1;
    return a[0] - '0' + 1;
  }
  if (a.size() > 1) answ += 10;
  for (int i = 2; i < a.size(); i++) answ += 9 * p[i - 2];
  inc = 0;
  if (a.size() != 1) {
    if (a[0] <= a[a.size() - 1]) answ++;
    if (a[0] == a[a.size() - 1]) inc = 1;
  }
  for (int i = 0; i < a.size(); i++) a[i] -= '0';
  for (int i = 0; i < a.size() - 1; i++) {
    if (a[i] != 0)
      if (i == 0)
        answ += (a[i] - 1) * p[a.size() - i - 2];
      else
        answ += a[i] * p[a.size() - i - 2];
  }
  return answ;
}
int main(void) {
  string a, b;
  cin >> a >> b;
  p[0] = 1;
  for (int i = 1; i <= 17; i++) p[i] = p[i - 1] * 10;
  int inc;
  long long int A = getUpTo(a, inc);
  if (inc) A--;
  long long int B = getUpTo(b, inc);
  cout << B - A << endl;
  return 0;
}
