N = int(raw_input()) a = map(int,raw_input().split()) maxValue,minValue = max(a),min(a) if maxValue == minValue: if a[0]/N-1 >= 4: print 0,N else: print N,0 else: print a.count(maxValue),a.count(minValue)