#include <bits/stdc++.h>
using namespace std;
int a[110];
int main() {
  int n;
  cin >> n;
  double sum = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a + 1, a + 1 + n);
  int ans = floor(sum / n + 0.5);
  int t = 0;
  while (ans < 5) {
    sum += 5 - a[1];
    a[1] = 5;
    sort(a + 1, a + 1 + n);
    ++t;
    ans = floor(sum / n + 0.5);
  }
  cout << t << endl;
  return 0;
}
