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>
#pragma GCC optimize("Ofast, unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native,avx2")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getrnd(ll l, ll r) { return uniform_int_distribution<ll>(l, r)(rng); }
template <typename T1, typename T2>
inline bool relax(T1& a, const T2& b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool strain(T1& a, const T2& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
struct line {
  ll k, b;
  ll eval(ll x) { return k * x + b; }
  ld intersect(line oth) { return (oth.b - b) / (k - oth.k); }
};
struct cht {
  deque<line> hull;
  void add(line x) {
    while (hull.size() >= 2 &&
           hull.front().intersect(x) >= hull[1].intersect(hull.front()))
      hull.pop_front();
    hull.push_front(x);
  }
  ll get(ll x) {
    while (hull.size() >= 2 &&
           hull.back().eval(x) <= hull[hull.size() - 2].eval(x))
      hull.pop_back();
    return hull.back().eval(x);
  }
};
void solve() {
  int n;
  cin >> n;
  vector<tuple<ll, ll, ll>> a;
  for (int i = 0; i < n; ++i) {
    ll x, y, c;
    cin >> x >> y >> c;
    a.emplace_back(x, y, c);
  }
  sort(a.begin(), a.end());
  ll ans = 0;
  cht hull;
  hull.add({0, 0});
  for (int i = 0; i < n; ++i) {
    auto [x, y, c] = a[i];
    ll res = x * y - c + hull.get(y);
    strain(ans, res);
    hull.add({-x, res});
  }
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  srand(time(0));
  int t = 1;
  while (t--) solve();
  return 0;
}
