#include <bits/stdc++.h>
using namespace std;
long long n, m;
int main() {
  cin >> n >> m;
  long long ans = 0;
  for (long long s = 5; s <= n + m; s += 5) {
    if (s <= n && s <= m) {
      ans += s - 1;
    } else if (s <= n && s > m) {
      ans += m;
    } else if (s > n && s <= m) {
      ans += n;
    } else if (s > n && s > m) {
      ans += n + m + 1 - s;
    }
  }
  cout << ans << endl;
  return 0;
}
