The Fair Nut got stacked in planar world. He should solve this task to get out.

You are given n rectangles with vertexes in (0, 0), (x_i, 0), (x_i, y_i), (0, y_i). For each rectangle, you are also given a number a_i. Choose some of them that the area of union minus sum of a_i of the chosen ones is maximum.

It is guaranteed that there are no nested rectangles.

Nut has no idea how to find the answer, so he asked for your help.

Input

The first line contains one integer n (1 ≤ n ≤ 10^6) — the number of rectangles.

Each of the next n lines contains three integers x_i, y_i and a_i (1 ≤ x_i, y_i ≤ 10^9, 0 ≤ a_i ≤ x_i ⋅ y_i).

It is guaranteed that there are no nested rectangles.

Output

In a single line print the answer to the problem — the maximum value which you can achieve.

Examples

Input


3
4 4 8
1 5 0
5 2 10


Output


9

Input


4
6 2 4
1 6 2
2 4 3
5 3 8


Output


10

Note

In the first example, the right answer can be achieved by choosing the first and the second rectangles.

In the second example, the right answer can also be achieved by choosing the first and the second rectangles.
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long double EPS = 1e-9;
struct rectangle {
  long long x, y, a;
};
bool cmp(rectangle r1, rectangle r2) {
  if (r1.x == r2.x) return r1.y > r2.y;
  return r1.x < r2.x;
}
pair<long long, long long> sub(pair<long long, long long> p1,
                               pair<long long, long long> p2) {
  p1.first -= p2.first;
  p1.second -= p2.second;
  return p1;
}
bool dotnegative(pair<long long, long long> p1, pair<long long, long long> p2) {
  long double val1 = p1.first * 1.0 * p2.first;
  long double val2 = p1.second * 1.0 * p2.second;
  return val1 + val2 < -EPS;
}
long long dot(pair<long long, long long> p1, pair<long long, long long> p2) {
  return p1.first * p2.first + p1.second * p2.second;
}
bool cross(pair<long long, long long> p1, pair<long long, long long> p2) {
  long double val1 = p1.first * 1.0 * p2.second;
  long double val2 = p2.first * 1.0 * p1.second;
  return val1 > val2;
}
vector<pair<long long, long long> > hull, vecs;
void add_line(pair<long long, long long> p1) {
  while (!vecs.empty() && dotnegative(vecs.back(), sub(p1, hull.back()))) {
    vecs.pop_back();
    hull.pop_back();
  }
  if (!hull.empty()) {
    pair<long long, long long> diff = sub(p1, hull.back());
    vecs.push_back({-diff.second, diff.first});
  }
  hull.push_back(p1);
}
long long query(long long x) {
  pair<long long, long long> pt = {x, 1};
  auto it = lower_bound(vecs.begin(), vecs.end(), pt, cross);
  return dot(pt, hull[it - vecs.begin()]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  rectangle r[n];
  for (int i = 0; i < n; i++) cin >> r[i].x >> r[i].y >> r[i].a;
  sort(r, r + n, cmp);
  long long dp[n];
  add_line({0, 0});
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    dp[i] = r[i].x * r[i].y - r[i].a - query(r[i].y);
    add_line({r[i].x, -dp[i]});
    ans = max(ans, dp[i]);
  }
  cout << ans << endl;
}
