#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-6;
void google(int i) { cout << "Case #" << i << ": "; }
long long int prime[1000000 + 1];
void sieve(long long int n) {
  for (long long int i = 0; i < n + 1; i++) prime[i] = 1;
  for (long long int i = 2; i * i <= n; i++) {
    if (prime[i] != 1) continue;
    for (long long int j = i * i; j <= n; j = j + i)
      if (prime[j] == 1) prime[j] = i;
  }
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int binarymul(long long int a, long long int n, long long int m) {
  long long int res = 1;
  while (n) {
    if (n % 2) {
      res = (res * a) % m;
      n--;
    }
    a = (a * a) % m;
    n /= 2;
  }
  return res;
}
void bfs(long long int s, vector<long long int> g[], long long int n) {
  bool vis[n];
  for (long long int i = 0; i < n; i++) vis[i] = false;
  vis[s] = true;
  deque<long long int> q;
  q.push_back(s);
  while (!q.empty()) {
    s = q.front();
    q.pop_front();
    for (long long int i = 0; i < g[s].size(); i++) {
      if (!vis[g[s][i]]) {
        vis[g[s][i]] = true;
        q.push_back(g[s][i]);
      }
    }
  }
}
void dfs(long long int u, vector<long long int> g[], bool *vis) {
  vis[u] = true;
  for (long long int i = 0; i < g[u].size(); i++)
    if (!vis[g[u][i]]) dfs(g[u][i], g, vis);
}
long long int a[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long int help(long long int n) {
  long long int ans = 0;
  while (n) {
    ans += (a[n % 10]);
    n /= 10;
  }
  return ans;
}
void contest(long long int t);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int T = 1;
  for (long long int t = 0; t < T; t++) {
    contest(t);
  }
  return 0;
}
void contest(long long int t) {
  long long int l, r;
  cin >> l >> r;
  long long int ans = 0;
  for (long long int i = l; i <= r; i++) ans += help(i);
  cout << ans << endl;
}
