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