#include <bits/stdc++.h>
using namespace std;
double a[1005];
int main() {
  double n;
  int i;
  cin >> n;
  double sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  double marks = sum;
  double needed = 4.5 * n;
  if (needed <= marks) {
    cout << "0";
  } else {
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (a[i] <= a[j]) {
          swap(a[i], a[j]);
        }
      }
    }
    for (i = 1; i <= n; i++) {
      marks = marks + (5.0 - a[i]);
      cnt++;
      if (marks >= needed) {
        cout << cnt << endl;
        break;
      }
    }
  }
}
