#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double a[n];
  int b[n];
  int k = 0;
  for (int i = 0; i < n; i++) {
    b[i] = 0;
  }
  double sum = 0;
  int num = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum = sum + a[i];
    if (a[i] != 5) {
      b[i] = a[i];
      num++;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < n - 1 - i; j++) {
      if (a[j] > a[j + 1]) {
        swap(a[j], a[j + 1]);
        swap(b[j], b[j + 1]);
      }
    }
  }
  int res = round(sum / n);
  if (res == 5) {
    cout << 0 << endl;
  } else {
    for (int j = 0; j < n; j++) {
      if (b[j] != 0) {
        double dis = 5 - b[j];
        k++;
        sum += dis;
        if (round(sum / n) == 5 || k == num) {
          cout << k;
          break;
        }
      }
    }
  }
  return 0;
}
