#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w = 0;
  cin >> n;
  float a[n + 2], tot = 0, avg = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    tot += a[i];
  }
  sort(a, a + n);
  avg = tot / n;
  if (avg < 4.5) {
    for (int i = 0; i < n; i++) {
      if (a[i] < 5) {
        tot += (5 - a[i]);
        avg = tot / n;
        w++;
      }
      if (avg >= 4.5) break;
    }
  }
  cout << w;
  return 0;
}
