#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int s = 0;
  for (int i = 0; i < n; i++) s += a[i];
  sort(a, a + n);
  int val = 0, idx = 0;
  while (s < 4.5 * n) s += (5 - a[idx++]), val++;
  cout << val << endl;
  return 0;
}
