#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 4;
void solve() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  float min = 4.5 * n;
  int mn = (int)min;
  if (min - mn > 0) mn++;
  int sum = 0;
  for (int i = 0; i < n; i++) sum += arr[i];
  int req = mn - sum;
  if (req <= 0) {
    cout << 0 << endl;
    return;
  }
  sort(arr, arr + n);
  int ans = 0, i = 0;
  while (req > 0) {
    req -= 5 - arr[i];
    i++;
    ans++;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
