#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > pq;
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    pq.push(x);
    sum += x;
  }
  int cnt = 0;
  while (pq.size()) {
    double d = ((double)sum / (double)n);
    d *= 10;
    int t = (int)d;
    if (t >= 45) break;
    int x = pq.top();
    pq.pop();
    sum -= x;
    sum += 5;
    cnt++;
  }
  cout << cnt << endl;
}
