#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  float sum = 0;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  float req = (4.5) * n;
  int ans = 0;
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (sum >= req) break;
    if (a[i] < 5) {
      ans++;
      sum += (5 - a[i]);
      a[i] = 5;
    }
  }
  cout << ans;
  return 0;
}
