#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, acc = 0;
  cin >> n;
  for (int i = 0, __ = n; i < __; ++i) {
    int a;
    cin >> a;
    acc += a;
  }
  ++n;
  int ans = 0;
  for (int i = 1, __ = 6; i < __; ++i) {
    if ((acc + i - 1) % n != 0) {
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}
