N = input() levels = map(int, raw_input().split()) democracy = [0] * 6 for l in levels: democracy[l-1] += 1 print democracy print 6- democracy[::-1].index(max(democracy))