#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
string t;
long long int dp[20][12][12][2][2];
long long int cal(long long int x, long long int d, long long int l,
                  long long int f, long long int f1) {
  if (x < 0) {
    return (d == l && d != 0);
  }
  long long int &r = dp[x][d][l][f][f1];
  if (r != -1) return r;
  r = 0;
  long long int u = 9;
  if (f == 0) u = t[x] - '0';
  for (long long int i = 0; i <= u; i++) {
    if (f1 == 0 && i == 0) {
      r += cal(x - 1, d, l, 1, 0);
      continue;
    } else if (f1 == 0) {
      r += cal(x - 1, i, i, i < u || f == 1, 1);
      continue;
    }
    r += cal(x - 1, d, i, i < u || f == 1, 1);
  }
  return r;
}
long long int fuck(long long int x) {
  if (x == 0) return 0;
  t.clear();
  while (x != 0) {
    t.push_back(x % 10 + '0');
    x /= 10;
  }
  memset(dp, -1, sizeof(dp));
  long long int ans = cal(t.size() - 1, 0, 0, 0, 0);
  return ans;
}
int main() {
  long long int x, y;
  while (cin >> x >> y) {
    x--;
    long long int ans = fuck(y) - fuck(x);
    cout << ans << endl;
  }
  return 0;
}
