N=int(input()) C=[[int(i) for i in input(). split ()] for i in range(N)] S=0 for i in range(N): e=int(C[i]/2)*D[i] S+=e print (S)