#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int aa[115];
  while (scanf("%d", &n) != EOF) {
    double sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> aa[i];
      sum += aa[i];
    }
    if (sum / n >= 4.5) {
      printf("0\n");
      continue;
    }
    if (sum / n >= 4.5) {
      printf("0\n");
      continue;
    }
    int mark11 = 0;
    mark11 += 1;
    int flag = 0;
    sort(aa, aa + n);
    for (int j = 0;; j++) {
      if (aa[j] != 5) {
        flag++;
        sum = sum - aa[j] + 5;
        if (sum / n >= 4.5) {
          printf("%d\n", flag);
          break;
        }
      }
    }
  }
  return 0;
}
