#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  int notes[n];
  int num[6] = {0};
  long long som = 0;
  for (long long i = 0; i < n; i++) {
    cin >> notes[i];
    num[notes[i]]++;
    som += notes[i];
  }
  double average = (double)som / n;
  if (round(average) == 5) {
    cout << "0";
    exit(0);
  }
  double two_cont = (double)3 / n;
  double three_cont = (double)2 / n;
  double four_cont = (double)1 / n;
  long counter = 0;
  while (num[2]--) {
    average += two_cont;
    counter++;
    if (round(average + 0.0001) == 5) {
      cout << counter;
      exit(0);
    }
  }
  while (num[3]--) {
    average += three_cont;
    counter++;
    if (round(average + 0.0001) == 5) {
      cout << counter;
      exit(0);
    }
  }
  while (num[4]--) {
    average += four_cont;
    counter++;
    if (round(average + 0.0001) == 5) {
      cout << counter;
      exit(0);
    }
  }
  cout << counter;
}
