#include <bits/stdc++.h>
using namespace std;
int n, a[105];
double tot, p;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    tot += a[i] * 1.0;
  }
  p = tot / n;
  if (p - int(p) >= 0.5 && ceil(p) >= 5 || floor(p) >= 5) {
    cout << 0;
    return 0;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    tot += (5 - a[i]) * 1.0;
    p = tot / n;
    if (p - int(p) >= 0.5 && ceil(p) >= 5 || floor(p) >= 5) {
      cout << i;
      return 0;
    }
  }
  cout << n;
  return 0;
}
