#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  double now = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    now += a[i];
  }
  int ans = 0;
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (now / (double)(n) >= 4.5) {
      break;
    }
    now = now - a[i] + 5;
    ans++;
  }
  printf("%d\n", ans);
}
