#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
int as[MAX_N];
int main() {
  int n;
  scanf("%d", &n);
  int s = 0;
  for (int i = 0; i < n; i++) scanf("%d", as + i), s += as[i];
  sort(as, as + n);
  double t = 4.5 * n;
  if (s >= t) {
    puts("0");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    s += 5 - as[i];
    if (s >= t) {
      printf("%d\n", i + 1);
      break;
    }
  }
  return 0;
}
