#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, sum = 0, ans = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  if (round((sum * 1.0) / n) == 5) return cout << ans << endl, 0;
  for (int i = 0; i < n && a[i] != 5; i++) {
    sum += (5 - a[i]);
    ans++;
    if (round((sum * 1.0) / n) == 5) return cout << ans << endl, 0;
  }
  return 0;
}
