#include <bits/stdc++.h>
using namespace std;
const int N = 101;
int n, s, ans;
int a[N];
int Cal(int x) {
  int c = (double)x / (double)n + 0.5;
  return c;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    s += a[i];
  }
  if (Cal(s) == 5) {
    cout << 0;
    return 0;
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    s -= a[i] - 5;
    if (Cal(s) == 5) {
      cout << i;
      return 0;
    }
  }
}
