#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 10;
int n, a[N];
inline void read() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
}
inline void solve() {
  int ans = 0;
  int sum = 0;
  sort(a, a + n);
  for (int i = 0; i < n; ++i) sum += a[i];
  if (sum >= 4.5 * n)
    cout << 0;
  else {
    int i = 0;
    while (sum < 4.5 * n) {
      sum += 5;
      sum -= a[i];
      ans++;
      i++;
    }
    cout << ans << endl;
  }
}
int main() {
  read();
  solve();
}
