#!/usr/bin/env python def read(): N = input() return N, map(int, raw_input().split()) def work((N, vList)): vList.sort() if vList[0] == vList[-1]: if vList[0] == (N - 1) * 2: print N, 0 else: print 0, N else: print vList.count(vList[-1]), vList.count(vList[0]) if __name__ == "__main__": work(read())