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