#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, a, s = 0, c = 0;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a;
    s += a;
  }
  for (long long int i = 1; i <= 5; i++) {
    s += i;
    if (s % (n + 1) != 1) c++;
    s -= i;
  }
  cout << c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
