#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  double n;
  cin >> n;
  vector<double> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  double _0 = 0;
  int c = 0;
  sort(a.begin(), a.end());
  double s = accumulate(a.begin(), a.end(), 0);
  for (int i = 0; i < n; ++i) {
    if (s / n < 4.5) {
      s -= a[i];
      s += 5;
      c++;
    }
  }
  cout << c << endl;
  return 0;
}
