#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int req = 45 * n;
  int a[n], sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    a[i] *= 10;
    sum += a[i];
  }
  sort(a, a + n);
  int ans = 0;
  if (sum >= req) {
    cout << ans << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    sum += (50 - a[i]);
    ans++;
    if (sum >= req) {
      cout << ans << endl;
      return 0;
    }
  }
  return 0;
}
