#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  double a[n];
  double total = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    total += a[i];
  }
  sort(a, a + n);
  int i = 0;
  while ((total / n) < 4.5) {
    total += (5 - a[i++]);
  }
  cout << i << endl;
}
