#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b = 0;
  cin >> n;
  vector<long long int> v;
  double t = 0;
  while (n--) {
    cin >> a;
    t += a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  int i = 0;
  double be = 4.5;
  be *= (v.size());
  while (t < be) {
    t -= v[i];
    t += 5;
    i++;
  }
  cout << i << endl;
  return 0;
}
