#include <bits/stdc++.h>
using namespace std;
int arr[150];
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  int ans = 0;
  int i = 0;
  while (1) {
    if (2 * sum >= 9 * n) break;
    ans++;
    sum -= arr[i];
    i++;
    sum += 5;
  }
  cout << ans << endl;
  return 0;
}
