#include <bits/stdc++.h>
using namespace std;
double a[102], pre[103];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  double total = 0;
  for (int x, i = 1; i <= n; i++) {
    cin >> a[i];
    total += a[i];
  }
  sort(a + 1, a + n + 1);
  if ((total / n) >= 4.5) {
    cout << "0\n";
    return 0;
  } else {
    int answer = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] < 5) {
        total += 5 - a[i];
        answer++;
      }
      if ((total / n) >= 4.5) break;
    }
    cout << answer << endl;
  }
  return 0;
}
