#include <bits/stdc++.h>
using namespace std;
const int MAXN(110), INF(0x3f3f3f3f);
int ct[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int n, m;
inline int read() {
  int f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
void init() {
  n = read();
  m = read();
}
void solve() {
  long long ans = 0;
  for (int i = n; i <= m; i++) {
    int k = i;
    while (k) {
      ans += ct[k % 10];
      k /= 10;
    }
  }
  printf("%I64d\n", ans);
}
int main() {
  {
    init();
    solve();
  }
}
