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