#include <bits/stdc++.h>
using namespace std;
float avg(float array[], int t) {
  float sum = 0;
  for (long long int q = 0; q < t; q++) {
    sum += array[q];
  }
  float y = (float)sum / (float)t;
  return y;
}
int main() {
  int t;
  cin >> t;
  float grades[100];
  for (long long int i = 0; i < t; i++) {
    cin >> grades[i];
  }
  sort(grades, grades + t);
  float avge = avg(grades, t);
  int i = 0;
  while (1) {
    if (avge >= 4.5) {
      break;
    } else {
      grades[i] = 5;
      avge = avg(grades, t);
      i++;
    }
  }
  cout << i;
}
