#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  float x, sum = 0;
  int i = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  float k = 4.5 * n;
  if (sum >= k)
    cout << 0;
  else {
    bool flag = true;
    sort(a, a + n);
    while (flag) {
      sum += 5 - a[i];
      i++;
      if (sum >= k) flag = false;
    }
    cout << i;
  }
  return 0;
}
