#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long power(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = (ans * x) % MOD;
    y >>= 1;
    x = (x * x) % MOD;
  }
  return ans % MOD;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
vector<long long> A(3);
long double AVERAGE(long long n) {
  long double SUM = accumulate(A.begin(), A.end(), 0);
  return (long double)(SUM / n);
}
set<char> buf;
long long a[120];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  ;
  long double sum = 0;
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a + 1, a + n + 1);
  long double k = n * (4.5);
  long long tmp = 0;
  for (long long i = 1; i <= n and sum < k; i++) {
    sum += (5 - a[i]);
    tmp++;
  }
  cout << tmp << endl;
  return 0;
}
