#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  int total = 0;
  for (int i = 0; i < num; i++) {
    int f;
    cin >> f;
    total += f;
  }
  int res = 0;
  for (int i = 1; i <= 5; i++) {
    if ((total + i) % (num + 1) != 1) {
      res++;
    }
  }
  cout << res << endl;
}
