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