#include <bits/stdc++.h>
using namespace std;
streambuf *cin_backup = cin.rdbuf(), *cout_backup = cout.rdbuf();
const int LN = 1e2 + 1, LK = 10, INF = 1e9;
int N;
vector<int> calf;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N;
  calf.resize(N);
  long double prom = 0;
  for (int i = 0; i < N; i++) cin >> calf[i], prom += (long double)(calf[i]);
  sort((calf).begin(), (calf).end());
  long double lim = 4.5;
  int pos = 0;
  while (pos < N && prom / N < lim) {
    prom -= calf[pos];
    prom += 5;
    pos++;
  }
  cout << pos;
  return 0;
}
