#include <bits/stdc++.h>
using namespace std;
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
int ara[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int sum(int x, int y) {
  int s = 0;
  for (int i = x; i <= y; i = (i + 1) % 10) {
    s += ara[i];
  }
  return s;
}
int main() {
  int n, m;
  string s, k;
  cin >> n >> m;
  if (n > m) swap(n, m);
  int cnt = 0;
  int ans = 0, i, j;
  for (int i = n; i <= m; i++) {
    for (int j = i; j > 0; j /= 10) {
      ans += ara[j % 10];
    }
  }
  cout << ans;
}
