#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long long req = ceil(4.5 * n) - sum;
  vector<long long> b(n);
  for (long long i = 0; i < n; i++) {
    b[i] = 5 - a[i];
  }
  bool check = 0;
  sort(b.begin(), b.end(), greater<long long>());
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (req <= 0) {
      cout << ans;
      check = 1;
      break;
    }
    req -= b[i];
    ans++;
  }
  if (!check) cout << n;
  return 0;
}
