#include <bits/stdc++.h>
using namespace std;
const int tam = 100010;
const int MOD = 1000000007;
const int MOD1 = 998244353;
const double EPS = 1e-9;
const double PI = acos(-1);
int seg[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  int res = 0;
  while (a <= b) {
    int x = a;
    while (x > 0) {
      res += seg[x % 10];
      x /= 10;
    }
    a++;
  }
  cout << res << '\n';
  return 0;
}
