#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, total = 0, answer(0);
  cin >> n;
  int x;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    total += x;
  }
  for (long long i = 1; i < 6; i++) {
    if ((total + i) % (n + 1) != 1) {
      answer++;
    }
  }
  cout << answer << endl;
  return 0;
}
