#include <bits/stdc++.h>
int main() {
  int n, f;
  while (scanf("%d", &n) == 1) {
    int sum = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &f);
      sum += f;
    }
    int p = sum % (n + 1);
    int c = 0;
    for (int i = 0; i < 5; i++) {
      p++;
      if (p == (n + 2)) p = 1;
      if (p == 1)
        ;
      else
        c++;
    }
    printf("%d\n", c);
  }
  return 0;
}
