#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, temp, cnt = 0, total = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    total += temp;
  }
  n++;
  for (int i = 1; i <= 5; i++) {
    if ((total + i) % n != 1) {
      cnt++;
    }
  }
  cout << cnt << "\n";
  return 0;
}
