#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  long long int n, i, ctr = 0;
  double s = 0, tmp;
  cin >> n;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  tmp = 4.5 * n;
  if (s >= (tmp))
    cout << "0";
  else {
    long long int m = 0;
    sort(a, a + n);
    for (i = 0; s < tmp && i < n; i++) {
      if (a[i] != 5) {
        s += 5 - a[i];
        m++;
      } else
        break;
    }
    cout << m;
  }
  return 0;
}
