#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int m, sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> m;
      sum += m;
    }
    int counter = 0;
    for (int i = 1; i <= 5; i++) {
      if (((sum + i) % (n + 1)) != 1) counter++;
    }
    cout << counter << endl;
  }
  return 0;
}
