#include <bits/stdc++.h>
using namespace std;
vector<double> grades;
int main() {
  double n, temp;
  cin >> n;
  vector<double> grades(n + 1);
  grades[0] = 100000000;
  int i;
  for (i = 1; i <= n; i++) {
    cin >> grades[i];
  }
  double sum = 0;
  for (i = 1; i <= n; i++) {
    sum += grades[i];
  }
  double avg = sum / n;
  if (avg >= 4.5) {
    cout << "0";
  } else {
    double numN = ceil((4.5 - avg) * n);
    sort(grades.begin(), grades.end());
    int i = 0;
    int ans = 0;
    while (numN > 0) {
      numN = numN - (5 - grades[i++]);
      ans++;
    }
    cout << ans;
  }
  return 0;
}
