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