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