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