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