#include <bits/stdc++.h>
using namespace std;
int main() {
  int freq;
  cin >> freq;
  int arr[freq];
  int sum = 0;
  int ans = 0;
  for (int i = 0; i < freq; i++) {
    cin >> arr[i];
    sum = sum + arr[i];
  }
  for (int i = 1; i <= 5; i++) {
    if ((sum + i) % (freq + 1) == 1) {
      continue;
    }
    ans += 1;
  }
  cout << ans;
}
