#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> v;
  int cnt = 0, e, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> e;
    sum += e;
    v.push_back(e);
  }
  sort(v.begin(), v.end());
  int idx = 0;
  double cur = (double)(sum) / n;
  while (cur < 4.5) {
    cnt++;
    sum -= v[idx++];
    sum += 5;
    cur = (double)(sum) / n;
  }
  cout << cnt << "\n";
  return 0;
}
