#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a, b, p, count = 0, i;
  cin >> n >> m;
  a = min(n, m);
  b = max(n, m);
  for (i = 1; i <= (a + b) / 5; i++) {
    p = i * 5;
    if (a >= p)
      count += p - 1;
    else if (b >= p)
      count += a;
    else
      count += (a + b) - p + 1;
  }
  cout << count;
}
