#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int a[N], n;
int main() {
  cin >> n;
  int now = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    now += a[i];
  }
  sort(a, a + n);
  int mx = (int)ceil(4.5 * n);
  if (now >= mx)
    printf("0\n");
  else {
    int s = mx - now;
    int res = 0;
    for (int i = 0; i < n; i++) {
      if (s <= 0) break;
      if (a[i] < 5) {
        s -= (5 - a[i]);
        res++;
      }
    }
    printf("%d\n", res);
  }
  return 0;
}
