#include <bits/stdc++.h>
using namespace std;
const int lim = 110;
int arr[lim];
int main() {
  int n;
  scanf("%d", &n);
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &arr[i]);
    sum += arr[i] * 10;
  }
  if (sum >= 45 * n) {
    printf("0");
  } else {
    sort(arr, arr + n);
    int cnt = 0;
    for (int i = 0; i < n and sum < 45 * n; ++i) {
      sum += (5 - arr[i]) * 10;
      cnt++;
    }
    printf("%d", cnt);
  }
}
