#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101], t = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    t += a[i];
  }
  int ans = 0;
  for (int j = 1; j <= 5; j++) {
    int k = t + j, i = 0;
    while (k) {
      k--;
      if (!k) break;
      i = ((i + 1) % (n + 1));
    }
    if (i != 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
