#include <bits/stdc++.h>
using namespace std;
long long as[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long a, b, z, ans;
int main() {
  cin >> a >> b;
  a--;
  while (a++ < b) {
    z = a;
    while (z) ans += as[z % 10], z /= 10;
  }
  cout << ans;
}
