#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  double a[n], r, t;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    r += a[i];
  }
  sort(a, a + n);
  r /= n;
  long long j = 0;
  while (r < 4.5) {
    a[j++] = 5;
    r = 0;
    for (long long i = 0; i < n; i++) {
      r += a[i];
    }
    r /= n;
  }
  cout << j << endl;
}
