#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double arr[101];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) arr[i] *= 10;
  double sum = 0;
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) sum += arr[i];
  double ans = sum / n;
  stringstream ss;
  string s = "";
  ss << ans;
  ss >> s;
  if (s.size() == 1 && (s[0] - '0') == 5) {
    puts("0");
    return 0;
  } else if (s.size() > 1 && ((s[0] - '0') >= 4 && (s[1] - '0') >= 5) ||
             (s[0] - '0') == 5) {
    puts("0");
    return 0;
  } else {
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (arr[i] != 50) {
        cnt++;
        sum -= arr[i];
        sum += 50;
      }
      ss.clear();
      s.clear();
      ans = sum / n;
      ss << ans;
      ss >> s;
      if (s.size() == 1 && (s[0] - '0') == 5) {
        cout << cnt << endl;
        return 0;
      } else if (s.size() > 1 && ((s[0] - '0') >= 4 && (s[1] - '0') >= 5) ||
                 (s[0] - '0') == 5) {
        cout << cnt << endl;
        return 0;
      }
    }
  }
  return 0;
}
