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