#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n], i, j, s = 0, c = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  for (i = 1; i <= 5; ++i) {
    if ((s + i) % (n + 1) != 1) {
      c += 1;
    }
  }
  cout << c << endl;
  return 0;
}
