import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List input = new ArrayList<>(); while (sc.hasNext()) { input.add(sc.nextLine()); } System.out.println(solve(input)); sc.close(); } public static int solve(List in) { in = new ArrayList<>(in); in.remove(0); int total = 0; for (int i = 0; i < in.size(); i++) { int s = Integer.valueOf(in.get(i).split(" ")[0]); int k = Integer.valueOf(in.get(i).split(" ")[1]); if (s % 2 == 0) { total += (s / 2) * k; } else { total += (s + 1) / 2 * k; } } return total; } }