#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
int mod = 998244353;
#define o_set tree<int, null_type,less<int>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
#define int long long

long long bin_pow(long long x, int pow) {
    if (pow == 0)return 1;
    if (pow % 2 == 1)return (x * bin_pow(x, pow - 1)) % mod;
    else {
        return bin_pow((x * x) % mod, pow / 2) % mod;
    }
}

int col = 0;

void dfs(int n, vector<vector<int> > &g) {
    col++;
    for (auto u: g[n])dfs(u, g);
}

signed main() {
    int n;
    cin >> n;
    int r = 0;
    vector<pair<int, int>>vec(n);
    for (int i = 0;i < n;i++) {
        int u, v;
        cin >> u >> v;
        if (v > 0) {
            r += max(-100000000LL, u + v * i);
        }else {
            r += max(-00000010000000LL, u);
        }
    }
    cout << r << endl;
}
