#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[200], n, c = 0;
  double sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  while (double(sum / n) < 4.5) {
    sum += (5 - a[c]);
    c++;
  }
  cout << c;
  return 0;
}
