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;
namespace IO {
const int BUFFER_SIZE = 1 << 15;
char input_buffer[BUFFER_SIZE];
int input_pos = 0, input_len = 0;
void _update_input_buffer() {
  input_len = fread(input_buffer, sizeof(char), BUFFER_SIZE, stdin);
  input_pos = 0;
}
inline char next_char(bool advance = true) {
  if (input_pos >= input_len) _update_input_buffer();
  return input_buffer[advance ? input_pos++ : input_pos];
}
inline bool isspace(char c) {
  return (unsigned char)(c - '\t') < 5 || c == ' ';
}
template <typename T>
inline void read_int(T &number) {
  while (isspace(next_char(false))) next_char();
  bool negative = next_char(false) == '-';
  if (negative) next_char();
  number = 0;
  while (isdigit(next_char(false))) number = 10 * number + (next_char() - '0');
  if (negative) number = -number;
}
}  // namespace IO
const bool CHECK_OVERFLOW64 = true;
const long long LL_INF = (long long)2e18 + 5;
struct point {
  long long x, y;
  point(long long _x = 0, long long _y = 0) : x(_x), y(_y) {}
  point operator-(const point &other) const {
    return point(x - other.x, y - other.y);
  }
};
long long cross(const point &a, const point &b) {
  return a.x * b.y - b.x * a.y;
}
int cross_sign(const point &a, const point &b) {
  if (CHECK_OVERFLOW64) {
    double double_value = (double)a.x * b.y - (double)b.x * a.y;
    if (abs(double_value) > 1e18) return double_value > 0 ? +1 : -1;
  }
  uint64_t uint64_value = (uint64_t)a.x * b.y - (uint64_t)b.x * a.y;
  if (uint64_value == 0) return 0;
  return uint64_value < 9e18 ? +1 : -1;
}
bool left_turn(const point &a, const point &b, const point &c) {
  return cross_sign(b - a, c - b) > 0;
}
struct monotonic_dp_hull {
  deque<point> points;
  void insert(const point &p) {
    assert(points.empty() || p.x >= points.back().x);
    if (points.empty()) {
      points.push_back(p);
      return;
    }
    if (p.x == points.back().x) {
      if (p.y <= points.back().y)
        return;
      else
        points.pop_back();
    }
    while (points.size() >= 2 &&
           left_turn(points[points.size() - 2], points.back(), p))
      points.pop_back();
    points.push_back(p);
  }
  void insert(long long a, long long b) { insert(point(a, b)); }
  long long query(long long x, long long y = 1) {
    static long long prev_x = -LL_INF, prev_y = 1;
    assert(prev_x == -LL_INF || x * prev_y >= prev_x * y);
    prev_x = x;
    prev_y = y;
    while (points.size() >= 2 &&
           x * (points[1].x - points[0].x) >= (points[0].y - points[1].y) * y)
      points.pop_front();
    return points[0].x * x + points[0].y * y;
  }
};
struct rectangle {
  int x = 0, y = 0;
  long long cost = 0;
  bool operator<(const rectangle &other) const { return x < other.x; }
};
int N;
vector<rectangle> rect;
int main() {
  IO::read_int(N);
  rect.resize(N);
  for (rectangle &r : rect) {
    IO::read_int(r.x);
    IO::read_int(r.y);
    IO::read_int(r.cost);
  }
  sort(rect.begin(), rect.end());
  monotonic_dp_hull hull;
  hull.insert(0, 0);
  long long best = 0;
  for (rectangle &r : rect) {
    long long value = (long long)r.x * r.y + hull.query(-r.y) - r.cost;
    best = max(best, value);
    hull.insert(r.x, value);
  }
  printf("%lld\n", best);
}
