#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int v[n];
    int s = 0;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      s += v[i];
    }
    int c = 0;
    for (int i = 1; i <= 5; i++) {
      int r = (s + i) % (n + 1);
      if (r != 1) c++;
    }
    cout << c << endl;
  }
  return 0;
}
