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