#include <bits/stdc++.h>
using namespace std;
int v[100];
int main() {
  int n;
  scanf("%d", &n);
  int s = 0;
  for (int i = 0; i < n; ++i) scanf("%d", v + i), s += v[i];
  int c = 0;
  for (int i = 1; i < 6; ++i) c += (s + i) % (n + 1) != 1;
  printf("%d\n", c);
  return 0;
}
