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