#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  scanf("%lld", &n);
  long long i, a[n];
  double xx = 0.0, yy = 0.0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    xx += a[i];
  }
  yy = xx;
  xx /= n;
  sort(a, a + n);
  if (xx >= 4.5) {
    cout << "0\n";
    return 0;
  } else {
    double z = 4.5 * n;
    long long c = 0;
    for (i = 0; i < n; i++) {
      yy = yy + (5 - a[i]);
      c++;
      if (yy >= z) break;
    }
    cout << c << endl;
  }
}
