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