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