N= int(input()) S=0 for x in range(0,N): C,D=map(int,input().split()) S+=D*(C//2) if C%2==0 else D*(C//2+1) print(S)