#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 10;
int n, a[maxn], num;
double sum;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum = (double)sum / n;
  if (sum >= 4.5) {
    cout << "0" << endl;
    return 0;
  }
  while (1) {
    sort(a + 1, a + 1 + n);
    sum = 0;
    num++;
    a[1] = 5;
    for (int i = 1; i <= n; i++) sum += a[i];
    if (sum / n >= 4.5) {
      cout << num << endl;
      return 0;
    }
  }
}
