#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, left, p, i, j;
  long long int sum = 0;
  cin >> n >> m;
  sum += (m / 10) * n;
  sum = sum * 2;
  for (i = 1; i <= n; i++) {
    p = m % 10;
    left = 5 - (i % 5);
    if (left <= p) sum++;
    if (left + 5 <= p) sum++;
  }
  cout << sum << endl;
  return 0;
}
