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