#include <bits/stdc++.h>
using namespace std;
bool cmp(double a, double b) { return a < b; }
int main() {
  int n;
  double num[105], sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
    sum += num[i];
  }
  double minn = 4.5 * n;
  if (sum >= minn) {
    cout << 0 << endl;
  } else {
    sort(num, num + n, cmp);
    double ss[105];
    ss[0] = 5.0 - num[0];
    for (int i = 1; i < n; i++) {
      ss[i] = 5.0 - num[i];
    }
    int i = 0;
    while (sum < minn) {
      sum += ss[i++];
    }
    cout << i << endl;
  }
}
