#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int a[N];
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  for (int i = 0; i <= n; ++i) {
    if (10 * sum >= 45 * n) {
      cout << i;
      break;
    }
    sum -= a[i];
    sum += 5;
  }
  return 0;
}
