N=int(input()) C=[[float(i) for i in input(). split ()] for i in range(N)] S=0 for i in range(N): if C[i][0]/2!=round(C[i][0]/2): e=round(C[i][0]/2) else: e=C[i][0]/2 e=e*C[i][1] S+=e print (int(S))