import java.util.Scanner;

public class No146 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long C[] = new long[N];
		long D[] = new long[N];
		for(int i = 0;i < N;i++) {
			C[i] = sc.nextLong();
			D[i] = sc.nextLong();
		}
		long sum = 0;
		for(int i = 0;i < N;i++) {
			if(C[i]%2 == 0) {
				sum += C[i]/2 * D[i];
			}else {
				sum += (C[i]/2 + 1) * D[i];
			}
		}
		
		System.out.println(sum);
	}
}