#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    sum += tmp;
  }
  int ret = 0;
  for (int i = 1; i < 6; i++) {
    if ((sum + i) % (n + 1) != 1) ret++;
  }
  cout << ret << "\n";
}
