#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
clock_t clk = clock();
long long int i, j, k;
void solve(void);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  while (t--) solve();
  return 0;
}
long long int fun(long long int x) {
  if (x == 0) return 6;
  if (x == 1) return 2;
  if (x == 2) return 5;
  if (x == 3) return 5;
  if (x == 4) return 4;
  if (x == 5) return 5;
  if (x == 6) return 6;
  if (x == 7) return 3;
  if (x == 8) return 7;
  if (x == 9) return 6;
}
void solve() {
  long long int ct = 0;
  long long int a, b;
  cin >> a >> b;
  for (i = a; i <= b; ++i) {
    j = i;
    while (j > 0) {
      ct += fun(j % 10);
      j /= 10;
    }
  }
  cout << ct << '\n';
}
