#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<int> x(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    sum += x[i];
  }
  int count = 0;
  ;
  for (int i = 1; i <= 5; i++) {
    if ((sum - 1 + i) % (n + 1) != 0) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
