#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void print_width(long long x) {
  std::cout << std::fixed;
  std::cout << std::setprecision(x);
}
bool rev(long long x, long long y) { return x > y; }
bool sortinrev(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.first > b.first);
}
long long modulo(long long x, long long N) { return (x % N + N) % N; }
long long max(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a <= b)
    return a;
  else
    return b;
}
long long diff(long long a, long long b) {
  if (a >= b)
    return a - b;
  else
    return b - a;
}
void pairsort(long long a[], long long b[], long long n) {
  pair<long long, long long> pairt[n];
  for (long long i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long isPrime(long long n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 or n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 or n % (i + 2) == 0) return 0;
  return 1;
}
long long C(long long n, long long r) {
  if (r > n - r) r = n - r;
  long long ans = 1;
  long long i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
long long modexpo(long long x, long long p) {
  long long res = 1;
  x = x % mod;
  while (p) {
    if (p % 2) res = res * x;
    p >>= 1;
    x = x * x % mod;
    res %= mod;
  }
  return res;
}
long long power(long long x, long long y, long long p = mod) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
string multiply(string num1, string num2) {
  long long len1 = num1.size();
  long long len2 = num2.size();
  if (len1 == 0 || len2 == 0) return "0";
  vector<long long> result(len1 + len2, 0);
  long long i_n1 = 0;
  long long i_n2 = 0;
  for (long long i = len1 - 1; i >= 0; i--) {
    long long carry = 0;
    long long n1 = num1[i] - '0';
    i_n2 = 0;
    for (long long j = len2 - 1; j >= 0; j--) {
      long long n2 = num2[j] - '0';
      long long sum = n1 * n2 + result[i_n1 + i_n2] + carry;
      carry = sum / 10;
      result[i_n1 + i_n2] = sum % 10;
      i_n2++;
    }
    if (carry > 0) result[i_n1 + i_n2] += carry;
    i_n1++;
  }
  long long i = result.size() - 1;
  while (i >= 0 && result[i] == 0) i--;
  if (i == -1) return "0";
  string s = "";
  while (i >= 0) s += std::to_string(result[i--]);
  return s;
}
long long sti(string s) {
  long long ans = 0;
  long long p = 1;
  for (long long i = s.size() - 1; i >= 0; i--) {
    ans = (ans + ((long long)(s[i] - '0') * p) % mod) % mod;
    p = (p * 10) % mod;
  }
  return ans;
}
void printArr(long long a[], long long n) {
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
}
void printVector(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void printVectorPair(vector<pair<long long, long long>> v) {
  for (long long i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << "\n";
  ;
  cout << "\n";
}
void time() {}
const long long N = 1e6 + 5;
const long long despacito = 1e9 + 7;
long long dp[N] = {0};
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  dp[0] = 6, dp[1] = 2, dp[2] = 5, dp[3] = 5, dp[4] = 4, dp[5] = 5, dp[6] = 6,
  dp[7] = 3, dp[8] = 7, dp[9] = 6;
  for (long long i = 10; i <= 1000000; i++) {
    dp[i] = dp[i / 10] + dp[(i % 10)];
  }
  long long a, b;
  cin >> a >> b;
  long long ans = 0;
  for (long long i = a; i <= b; i++) {
    ans += dp[i];
  }
  cout << ans << "\n";
  return 0;
}
