#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  float avg = (float)(accumulate(arr, arr + n, 0) / (float)n);
  sort(arr, arr + n);
  int cnt = 0;
  while (avg < 4.5) {
    cnt++;
    arr[0] = 5;
    avg = (float)(accumulate(arr, arr + n, 0) / (float)n);
    sort(arr, arr + n);
  }
  cout << cnt;
  return 0;
}
