#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long q1 = n / 10;
  long long q2 = m / 10;
  int r1 = n % 10;
  int r2 = m % 10;
  long long a = 0;
  for (int i = 0; i <= 5; i++) {
    long long x = q1;
    if (i <= r1 && i) x++;
    long long y = q2;
    if (5 - i <= r2 && 5 - i) y++;
    a += x * y;
  }
  for (int i = 1; i <= 9; i++) {
    long long x = q1;
    if (i <= r1) x++;
    long long y = q2;
    if (10 - i <= r2) y++;
    a += x * y;
  }
  a += q1 * q2;
  for (int i = 6; i <= 9; i++) {
    long long x = q1;
    if (i <= r1) x++;
    long long y = q2;
    if (15 - i <= r2) y++;
    a += x * y;
  }
  cout << a;
}
