https://codeforces.com/problemset/problem/272/A
#include<bits/stdc++.h>
using namespace std;
int a[105],n,sum;
int main(void)
{
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],sum+=a[i];
int cnt=0;
for(int i=1;i<=5;i++)
{
if((sum+i)%(n+1)!=1) cnt++;
}
cout<<cnt<<endl;
}