#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, y = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    x += t;
  }
  n++;
  x = x % n;
  if ((x + 1) % n != 1) y++;
  if ((x + 2) % n != 1) y++;
  if ((x + 3) % n != 1) y++;
  if ((x + 4) % n != 1) y++;
  if ((x + 5) % n != 1) y++;
  cout << y << endl;
  return 0;
}
