#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  vector<int> num(5);
  for (int i = 0; i < 5; i++) num[i] = i + 1;
  int count = 0;
  for (int i = 0; i < 5; i++) {
    if ((sum + num[i]) % (n + 1) != 1) count++;
  }
  cout << count;
  return 0;
}
