#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e10 + 2;
const double eps = 0;
const int ms = 0;
const int md = 0;
const int mxn = 105;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int temp = n;
  int hand, total = 0, ans = 0;
  while (temp--) {
    cin >> hand;
    total += hand;
  }
  for (int i = 1; i <= 5; i++) {
    total += 1;
    if (total % (n + 1) != 1) {
      ans += 1;
    }
  }
  cout << ans;
}
