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 int64_t inf = (int64_t)1e17 + 42;
struct LiChaoMax {
  struct Line {
    long long a, b;
    Line() {
      a = 0;
      b = 0;
    }
    Line(long long _a, long long _b) {
      a = _a;
      b = _b;
    }
    long long eval(long long x) { return a * 1ll * x + (long long)b; }
  };
  struct Node {
    Node *l, *r;
    Line f;
    Node() {
      f = Line();
      l = nullptr;
      r = nullptr;
    }
    Node(long long a, long long b) {
      f = Line(a, b);
      l = nullptr;
      r = nullptr;
    }
    Node(Line v) {
      f = v;
      l = nullptr;
      r = nullptr;
    }
  };
  typedef Node* NodePointer;
  NodePointer root;
  int sz;
  void init(int _sz) {
    sz = _sz + 1;
    root = nullptr;
  }
  void addLine(long long a, long long b) {
    Line v = Line(a, b);
    insert(v, -sz, sz, root);
  }
  long long query(int x) { return query(x, -sz, sz, root); }
  void insert(Line& v, int l, int r, NodePointer& nd) {
    if (!nd) {
      nd = new Node(v);
      return;
    }
    int64_t trl = nd->f.eval(l), trr = nd->f.eval(r);
    int64_t vl = v.eval(l), vr = v.eval(r);
    if (trl >= vl && trr >= vr) return;
    if (trl < vl && trr < vr) {
      nd->f = v;
      return;
    }
    int mid = (l + r) >> 1;
    if (trl < vl) swap(nd->f, v);
    if (nd->f.eval(mid) > v.eval(mid))
      insert(v, mid + 1, r, nd->r);
    else
      swap(nd->f, v), insert(v, l, mid, nd->l);
  }
  long long query(int x, int l, int r, NodePointer& nd) {
    if (!nd) return -inf;
    if (l == r) return nd->f.eval(x);
    int mid = (l + r) >> 1;
    if (mid >= x) return max(nd->f.eval(x), query(x, l, mid, nd->l));
    return max(nd->f.eval(x), query(x, mid + 1, r, nd->r));
  }
} tree;
struct Rect {
  long long x, y, a;
};
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<Rect> rects(n);
  for (auto& rect : rects) {
    cin >> rect.x >> rect.y >> rect.a;
  }
  sort(rects.begin(), rects.end(),
       [](const Rect& r1, const Rect& r2) { return r1.x < r2.x; });
  tree.init(1e9 + 3);
  long long res = 0;
  tree.addLine(0, 0);
  for (auto& rect : rects) {
    long long tmp = tree.query(rect.y);
    tmp += rect.x * rect.y - rect.a;
    res = max(res, tmp);
    tree.addLine(-rect.x, tmp);
  }
  cout << res;
}
