import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] input = new String[sc.nextInt() + 2]; int i = 1; input[0] = String.valueOf(input.length); while (sc.hasNext()) { input[i] = sc.nextLine(); i++; } System.out.println(solve(input)); sc.close(); } public static int solve(String[] in) { int N = Integer.valueOf(in[0]); int[][] cc = new int[N][]; for (int i = 1; i < N + 1; i++) { cc[i - 1] = new int[2]; cc[i - 1][0] = Integer.valueOf(in[i].split(" ")[0]); cc[i - 1][1] = Integer.valueOf(in[i].split(" ")[1]); } int total = 0; for (int i = 0; i < N; i++) { if (cc[i][0] % 2 == 0) { total += (cc[i][0] / 2) * cc[i][1]; } else { total += (cc[i][0] + 1) / 2 * cc[i][1]; } } return total; } }