#include <bits/stdc++.h>
using namespace std;
int CASE = 1;
void solve() {
  int n, cnt = 0;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i], cnt += v[i];
  sort(v.begin(), v.end());
  if ((double)cnt / n + 0.5 >= 5)
    cout << 0 << endl;
  else {
    int step = 1;
    for (int i = 0; i < n; i++) {
      cnt += 5 - v[i];
      if ((double)cnt / n + 0.5 >= 5) {
        cout << step << endl;
        return;
      }
      step++;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
}
