#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;
const int n_ = 1e6 + 1000;
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
int cnt[20], a, b, sum;
int boz(int n) {
  int ret = 0;
  while (n) {
    ret += cnt[n % 10];
    n /= 10;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cnt[0] = 6;
  cnt[1] = 2;
  cnt[2] = 5;
  cnt[3] = 5;
  cnt[4] = 4;
  cnt[5] = 5;
  cnt[6] = 6;
  cnt[7] = 3;
  cnt[8] = 7;
  cnt[9] = 6;
  cin >> a >> b;
  for (int i = a; i <= b; i++) {
    sum += boz(i);
  }
  cout << sum << "\n";
  return 0;
}
