import std.stdio, std.conv, std.string; import std.math, std.algorithm, std.array; void main(){ int n = readln.strip.to!int; long sum = 0; foreach(i;0..n){ auto input = readln.strip.split.map!(to!int).array; sum += ceil(input[0] / 2f) * input[1]; } writeln(sum); }