N=int(input()) S=input() ANS=0 REST=[] for x in S: if x in {"3","5","7"}: ANS+=1 else: REST.append(x) ONE=0 NINE=0 LEN=len(REST) USE=[0]*len(REST) while True: while ONE=LEN or NINE2>=LEN or ONE>=LEN: break else: ANS+=1 USE[ONE]=1 USE[NINE1]=1 USE[NINE2]=1 ONE+=1 NINE1=NINE2+1 NINE2+=1 REST2=[] for i in range(len(REST)): if USE[i]==0: REST2.append(REST[i]) REST=REST2 #print(ANS,REST) ANS+=REST.count("1")//2 print(ANS)