#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long a, b;
  cin >> a >> b;
  long long count = 0;
  while (b >= a) {
    ostringstream str1;
    str1 << a;
    string str2 = str1.str();
    for (long long i = 0; i < str2.length(); i++) {
      if (str2[i] == '2' || str2[i] == '3' || str2[i] == '5') {
        count += 5;
      } else if (str2[i] == '0' || str2[i] == '6' || str2[i] == '9') {
        count += 6;
      } else if (str2[i] == '1') {
        count += 2;
      } else if (str2[i] == '4') {
        count += 4;
      } else if (str2[i] == '7') {
        count += 3;
      } else if (str2[i] == '8') {
        count += 7;
      }
    }
    a++;
  }
  cout << count << endl;
  return 0;
}
