#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, p;
  cin >> t;
  p = t;
  vector<int> v;
  int sum = 0;
  while (p--) {
    int number;
    cin >> number;
    sum += number;
    v.push_back(number);
  }
  if (round((double)sum / t) >= 5)
    cout << 0 << endl;
  else {
    int subjectNum = 0;
    int numberToBeChanged = 0;
    sort(v.begin(), v.end());
    while (round((double)sum / t) < 5) {
      if (v[subjectNum] < 5) {
        int extraAdded = 5 - v[subjectNum];
        sum += extraAdded;
        numberToBeChanged++;
        subjectNum++;
      } else
        subjectNum++;
    }
    cout << numberToBeChanged << endl;
  }
  return 0;
}
