#include <bits/stdc++.h>
using namespace std;
int n;
double a[105];
double sum[105];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  sort(a, a + n);
  sum[0] = a[0];
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + a[i];
  double res = n * 4.5;
  if (sum[n - 1] >= res)
    printf("0\n");
  else {
    for (int i = 0; i < n; i++) {
      if ((i + 1) * 5.0 + sum[n - 1] - sum[i] >= res) {
        printf("%d\n", i + 1);
        break;
      }
    }
  }
  return 0;
}
