#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  priority_queue<int, vector<int>, greater<int>> a;
  double pass = 0;
  while (n--) {
    int score;
    cin >> score;
    pass += (double)score - 4.5;
    a.push(score);
  }
  int x = 0;
  while (pass < 0) {
    int y = a.top();
    a.pop();
    pass += 5 - y;
    ++x;
  }
  cout << x << endl;
  return 0;
}
