#include <bits/stdc++.h>
using namespace std;
const int N = 100010, INF = 10000000000;
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    sum += a;
  }
  int kol = 0;
  for (int i = 1; i <= 5; i++)
    if ((sum + i - 1) % (n + 1) != 0) kol++;
  cout << kol;
  return 0;
}
