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