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