N = int(raw_input()) a = map(int,raw_input().split()) s = sum(a) t,k = 0,0 while s > 0: if s >= 4: s -= 4 k +=1 else: s -= 2 t += 1 print k,t