#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, ans = 0, c = 0;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    c += a[i];
  }
  sort(a, a + n);
  for (long long i = 0; i < n; i++) {
    if (round(1.0 * c / n) == 5) break;
    ans++;
    c -= a[i] - 5;
  }
  cout << ans;
  return 0;
}
