#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int maxm = 1e6 + 10;
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const double eps = 1e-7;
int n;
double a[maxn];
int cal() {
  double sum = 0;
  for (int i = 1; i <= n; i++) sum += a[i];
  double ave = sum / n;
  double r = ceil(ave);
  double l = floor(ave);
  double c = (l + r) / 2;
  if (ave >= c)
    return r;
  else
    return l;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  if (cal() == 5) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    a[i] = 5;
    if (cal() == 5) {
      cout << i << endl;
      return 0;
    }
  }
  return 0;
}
