#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, sum = 0, cnt = 0;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  float ans = ((float)sum / n);
  if (ans < 4.5) {
    int i = 0;
    while (true) {
      sum -= arr[i];
      sum += 5;
      cnt++;
      if (((float)sum / n) >= 4.5) break;
      i++;
    }
    cout << cnt << '\n';
  } else
    cout << 0 << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
