#include <bits/stdc++.h>
using namespace std;
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  double avg, sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  avg = sum / n;
  if (avg >= 4.5) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    sum += 5 - a[i];
    avg = sum / n;
    if (avg >= 4.5) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  return 0;
}
