#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
const double eps = 1e-9;
int a[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int n, sum = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i], sum += a[i];
  sort(a, a + n);
  int ans = 0;
  while (fabs(round(1.0 * sum / n) - 5.0) > eps) {
    sum += 5 - a[0];
    ++ans;
    a[0] = 5;
    sort(a, a + n);
  }
  cout << ans << endl;
  return 0;
}
