#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int base = 0;
  int mod = n + 1;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    base += temp;
  }
  int dimaTurn = 0;
  for (int i = 1; i <= 5; i++) {
    base++;
    if (base % mod != 1) {
      dimaTurn++;
    }
  }
  cout << dimaTurn << endl;
}
