#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, ans = 0;
  cin >> n;
  double a[n], sum = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum / n >= 4.5)
    cout << 0;
  else {
    sort(a, a + n);
    for (i = 0; i < n; i++) {
      if (a[i] != 5) {
        sum = sum + 5 - a[i];
        a[i] = 5;
        ans++;
        if (sum / n >= 4.5) {
          cout << ans;
          return 0;
        }
      }
    }
  }
}
