n=int(input())
a=list(map(int,input().split()))

def trib(n):
  if not(dp[n]==-1):
    return dp[n]
  else:
    dp[n]=(trib(n-1)+trib(n-2)+trib(n-3))%10007
    return dp[n]
  
sums=[0]
for i in counts(n):
  res+=comb2(counts[i])
  
print(sums)
counts=collections.counter(sums)
print(counts)
