#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int N = 1e5 + 5;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  double sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  int ans = 0, i = 0;
  while (sum / n < 4.5) {
    sum += 5 - a[i++];
  }
  cout << i << endl;
  return 0;
}
