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