#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long maxn = 3e5 + 123;
const long long inf = 1e9 + 123;
const long long linf = 1e18 + 123;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
const double pi = acos(-1);
int dx[8] = {0, 1, -1, 0, 1, -1, 1, -1};
int dy[8] = {1, 0, 0, -1, 1, 1, -1, -1};
int f(int x) {
  if (x == 1) {
    return 2;
  }
  if (x == 7) {
    return 3;
  }
  if (x == 4) {
    return 4;
  }
  if (x == 2 || x == 3 || x == 5) {
    return 5;
  }
  if (x == 0 || x == 6 || x == 9) {
    return 6;
  }
  if (x == 8) {
    return 7;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  long long ans = 0;
  for (int i = a; i <= b; i++) {
    int ii = i;
    while (ii) {
      ans += f(ii % 10);
      ii /= 10;
    }
  }
  cout << ans;
  exit(0);
}
