#include <bits/stdc++.h>
using namespace std;
const int N = 102;
int v[N];
int n;
bool ok() {
  double sum = 0;
  for (int i = 0; i < n; i++) {
    sum += v[i];
  }
  if (round(sum / double(n)) == 5.0) return 1;
  return 0;
}
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i]);
  }
  sort(v, v + n);
  int ans = 0;
  for (int i = 0; i < n and !ok(); i++) {
    v[i] = 5;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
