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