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