#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  int sum = 0, res = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    sum += a;
  }
  for (int i = 1; i <= 5; i++)
    if ((i + sum) % (n + 1) != 1) res++;
  printf("%d\n", res);
  return 0;
}
