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;
template <class T, size_t N>
ostream& operator<<(ostream& os, const array<T, N>& v);
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T, size_t N>
ostream& operator<<(ostream& os, const array<T, N>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const set<T1, T2>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const multiset<T1, T2>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2, class T3>
ostream& operator<<(ostream& os, const map<T1, T2, T3>& v) {
  bool f = 1;
  os << "[";
  for (auto& ii : v) {
    if (!f) os << ", ";
    os << "(" << ii.first << " -> " << ii.second << ") ";
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const multimap<T1, T2>& v) {
  bool f = 1;
  os << "[";
  for (auto& ii : v) {
    if (!f) os << ", ";
    os << "(" << ii.first << " -> " << ii.second << ") ";
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, priority_queue<T1, T2> v) {
  bool f = 1;
  os << "[";
  while (!v.empty()) {
    auto x = v.top();
    v.pop();
    if (!f) os << ", ";
    f = 0;
    os << x;
  }
  return os << "]";
}
template <class T1, class T2>
void printarray(const T1& a, T2 l, T2 r) {
  for (T2 i = l; i <= r; i++) cout << a[i] << (i < r ? " " : "");
}
void cio() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(15);
}
void die() {
  printf("-1\n");
  exit(0);
}
int xx[4] = {1, -1, 0, 0}, yy[4] = {0, 0, 1, -1};
const long long mod = 1e9 + 7;
inline long long f(pair<long long, long long> l, long long x) {
  return l.first * x + l.second;
}
struct LiChaoTree {
  struct Node {
    long long l, r, ln, rn;
    pair<long long, long long> s;
    Node(long long L, long long R, pair<long long, long long> ss) {
      l = L;
      r = R;
      ln = rn = -1;
      s = ss;
    }
  };
  vector<Node> v;
  void init(long long L, long long R) {
    Node nd(L, R, {0, -1e18});
    v.push_back(nd);
  }
  void insert(int node, pair<long long, long long> s) {
    long long L = v[node].l, R = v[node].r;
    pair<long long, long long> l1 = v[node].s;
    pair<long long, long long> l2 = s;
    long long M = (L + R) >> 1;
    if (f(l1, L) == f(l2, L)) {
      if (f(l1, R) >= f(l2, R))
        v[node].s = l1;
      else
        v[node].s = l2;
      return;
    }
    if (f(l1, L) < f(l2, L)) swap(l1, l2);
    if (f(l1, R) >= f(l2, R)) {
      v[node].s = l1;
      return;
    }
    if (f(l1, M) < f(l2, M)) {
      v[node].s = l2;
      if (v[node].ln == -1) {
        Node nd(L, M, l1);
        v[node].ln = (int)v.size();
        v.push_back(nd);
      } else
        insert(v[node].ln, l1);
    } else {
      v[node].s = l1;
      if (v[node].rn == -1) {
        Node nd(M + 1, R, l2);
        v[node].rn = (int)v.size();
        v.push_back(nd);
      } else
        insert(v[node].rn, l2);
    }
  }
  long long query(int node, long long p) {
    if (node == -1) return -1e18;
    long long res = f(v[node].s, p);
    long long M = (v[node].l + v[node].r) >> 1;
    if (v[node].l <= p && p <= M)
      res = max(res, query(v[node].ln, p));
    else
      res = max(res, query(v[node].rn, p));
    return res;
  }
};
int N;
vector<pair<pair<long long, long long>, long long>> v;
long long dp[1000200];
int main() {
  LiChaoTree tree;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    long long x, y, a;
    scanf("%lld%lld%lld", &x, &y, &a);
    v.push_back({{x, y}, a});
  }
  tree.init(1, 1e9);
  sort(v.begin(), v.end());
  long long ans = -1e18;
  tree.insert(0, pair<long long, long long>(0, 0));
  for (int i = 0; i < N; i++) {
    long long x = v[i].first.first, y = v[i].first.second, a = v[i].second;
    long long D;
    D = x * y - a + tree.query(0, y);
    tree.insert(0, pair<long long, long long>(-x, D));
    ans = max(ans, D);
  }
  printf("%lld\n", ans);
}
