#include <bits/stdc++.h>
using namespace std;
int n = 0, k[105], cnt = 0, sum = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k[i];
    sum += k[i];
  }
  for (int i = 1; i < 6; i++) {
    if ((sum + i) % (n + 1) == 1) {
      cnt++;
    }
  }
  cout << 5 - cnt << '\n';
}
