#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, count = 0, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    sum += a;
  }
  if ((sum + 1) % (n + 1) == 1) {
    count++;
  }
  if ((sum + 2) % (n + 1) == 1) {
    count++;
  }
  if ((sum + 3) % (n + 1) == 1) {
    count++;
  }
  if ((sum + 4) % (n + 1) == 1) {
    count++;
  }
  if ((sum + 5) % (n + 1) == 1) {
    count++;
  }
  cout << endl << 5 - count << endl;
}
