Seongmin is taking calculus this semester. While working through the homework on differentiating polynomials, he got tired of doing it by hand, so he decided to write a program that takes a function f(x) and returns its derivative f′(x) for him.
You are given the coefficient and the degree of every term of a polynomial f(x). Compute f′(1).
Input
The first line contains the number of terms N (1 ≤ N ≤ 100).
Each of the next N lines contains the coefficient C (-100 ≤ C ≤ 100, C ≠ 0) and the degree K (0 ≤ K ≤ 1000) of one term, separated by a space. The terms are given in decreasing order of degree, and no degree appears more than once.