#include <bits/stdc++.h>
using namespace std;
int sol(int sum, int n) {
  int sm = 0;
  for (int i = 1; i <= 5; i++) {
    if ((sum + i) % n != 1) sm++;
  }
  return sm;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, m, x;
  cin >> n;
  m = n++;
  int sum = 0;
  while (m--) {
    cin >> x;
    sum += x;
  }
  cout << sol(sum, n);
  return 0;
}
