///@author Sycamore, ZJNU; ///@date 8/6/2017 #include<iostream> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); int n; while (cin >> n&&~n) { int s,t,_t=0,d=0; while (n--) { cin >> s >> t; d += s*(t-_t); _t = t; } cout << d << " miles\n"; } return 0; }