#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, t = 5, s = 0;
  cin >> n;
  vector<int> v(n);
  for (auto &x : v) cin >> x, s += x;
  n += 1;
  for (int i = 1; i <= 5; i++)
    if ((s + i) % n == 1) t--;
  cout << t;
}
