#include <bits/stdc++.h>
using namespace std;
const long long MAX_SIZE = 1000001;
vector<long long> isprime(MAX_SIZE, true);
vector<long long> prime;
vector<long long> SPF(MAX_SIZE);
void fast_seive() {
  long long N = 100000;
  isprime[0] = isprime[1] = false;
  for (long long i = 2; i < N; i++) {
    if (isprime[i]) {
      prime.push_back(i);
      SPF[i] = i;
    }
    for (long long j = 0;
         j < (long long)prime.size() && i * prime[j] < N && prime[j] <= SPF[i];
         j++) {
      isprime[i * prime[j]] = false;
      SPF[i * prime[j]] = prime[j];
    }
  }
}
long long nx(long long i, long long m, long long n) {
  return (i + m - 1) % n + 1;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> res;
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    long long l;
    cin >> l;
    s += l;
  }
  long long m = 0;
  for (long long i = 1; i <= 5; i++) {
    if (((i + s - 1) % (n + 1))) {
      m++;
    }
  }
  cout << m << '\n';
  return 0;
}
