#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int s = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    s += x;
  };
  int cnt = 0;
  for (int j = 1; j <= 5; ++j) {
    if ((s + j) % (n + 1) != 1) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
