#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10000000000")
#pragma GCC optimize("O3")
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000007LL;
const long long INF2 = 1000000007LL * 1000000007LL;
const long double EPS = 1e-9;
const int SIZE = 200100;
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1000000000, 1000000000);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b, ans = 0;
  cin >> a >> b;
  int cnt[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  for (int i = a; i <= b; ++i) {
    int k = i;
    while (k) {
      ans += cnt[k % 10];
      k /= 10;
    }
  }
  cout << ans;
  return 0;
}
