#include <bits/stdc++.h>
using namespace std;
long long dp[30][20];
int a[30], l;
int i;
long long dfs(int pos, int fb, int bound) {
  int lim = bound ? a[pos] : 9;
  if (pos == -1) return 1;
  if (!bound && dp[pos][fb] != -1) return dp[pos][fb];
  long long ans = 0;
  for (int i = 0; i <= lim; i++) {
    int nfb;
    if (fb == 0)
      nfb = i;
    else
      nfb = fb;
    int nbound;
    if (i == lim && bound)
      nbound = 1;
    else
      nbound = 0;
    if (pos == 0 && i != nfb) continue;
    ans += dfs(pos - 1, nfb, nbound);
  }
  if (!bound) dp[pos][fb] = ans;
  return ans;
}
long long ac(long long x) {
  memset(dp, -1, sizeof(dp));
  l = 0;
  while (x) {
    a[l++] = x % 10;
    x /= 10;
  }
  return dfs(l - 1, 0, 1);
}
int main() {
  long long s, t;
  scanf("%I64d%I64d", &s, &t);
  printf("%I64d\n", ac(t) - ac(s - 1));
  return 0;
}
