#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], count = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  while (sum < 4.5 * n) {
    sum += 5 - a[count];
    count++;
  }
  cout << count << endl;
  return 0;
}
