#include <bits/stdc++.h>
using namespace std;
long long n, m, k, mod = 1e9 + 7;
map<long long, long long> mp;
vector<long long> a(10);
string s;
long long summ(long long x) {
  return (x < 10 ? a[x] : (summ(x / 10) + a[x % 10]));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  cin >> n >> m;
  a[0] = 6;
  a[1] = 2;
  a[2] = 5;
  a[3] = 5;
  a[4] = 4;
  a[5] = 5;
  a[6] = 6;
  a[7] = 3;
  a[8] = 7;
  a[9] = 6;
  long long ans = 0;
  for (long long i = n; i <= m; ++i) ans += summ(i);
  cout << ans;
}
