#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
template <class T>
inline T gethash(T h[], T power[], int l, int r) {
  if (r < l) return (T)0;
  return h[l] - h[r + 1] * power[r - l + 1];
}
struct data {
  data() {}
  bool friend operator<(data a, data b) { return 0; }
};
int n, m, k;
long long N, M, K;
int a[1005];
int main() {
  int t, tc = 1;
  scanf("%d", &n);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] *= 100000;
    sum += a[i];
  }
  sort(a + 1, a + n + 1);
  int lagbe = 0;
  for (int i = 1; i <= n; i++) {
    double x = sum * 1.0 / n;
    if (x >= 450000) {
      printf("%d", lagbe);
      return 0;
    }
    sum -= a[i];
    sum += 5 * 100000;
    lagbe++;
  }
  printf("%d", lagbe);
  return 0;
}
