#include using namespace std; int main(void){ long long a,b,c,sum=0; cin>>a; for (int i = 0; i < a; ++i) { cin>>b>>c; if(b%2==0){ sum=sum+((b/2*c)); }else{ sum=sum+(((b+1)/2*c)); } } cout<