#include <bits/stdc++.h>
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int sum = 0, i, num, he = 0, div = n + 1;
    for (i = 1; i <= n; i++) {
      scanf("%d", &num);
      sum += num;
    }
    for (i = 1; i <= 5; i++) {
      if ((sum + i) % div == 1) he++;
    }
    printf("%d\n", 5 - he);
  }
}
