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.
import java.io.*;
import java.util.*;

public class A {

	static Deque<line> hull;

	static void insert(line add) {
		while (hull.size() >= 2) {
			line last = hull.pollLast();
			if (last.intersect(add) < last.intersect(hull.peekLast())) {
				hull.addLast(last);
				break;
			}
		}
		hull.addLast(add);
	}

	static long query(long x) {
		while (hull.size() >= 2) {
			line first = hull.pollFirst();
			if (first.eval(x) > hull.peekFirst().eval(x)) {
				hull.addFirst(first);
				break;
			}
		}
		return hull.peekFirst().eval(x);
	}

	static class line {
		long m, c;

		line(long mm, long cc) {
			m = mm;
			c = cc;
		}

		long eval(long x) {
			return m * x + c;
		}

		double intersect(line line) {
			return (line.c - c) * 1.0 / (m - line.m);
		}

	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		hull = new LinkedList<>();
		int n = sc.nextInt(), x[] = new int[n], y[] = new int[n];
		long[] a = new long[n];
		Integer[] indices = new Integer[n];
		for (int i = 0; i < n; i++) {
			indices[i] = i;
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			a[i] = sc.nextLong();
		}
		Arrays.sort(indices, Comparator.comparingInt(i -> x[i]));
		long[] dp = new long[n];
		long ans = Long.MIN_VALUE;
		hull.add(new line(0, 0));
		// dp[i] = area(i) - a[i] + max( dp(j) - x[j] * y[i] )
		for (int idx : indices) {
			dp[idx] = -(long) 1e18;
			dp[idx] = query(y[idx]) + x[idx] * 1L * y[idx] - a[idx];
			insert(new line(-x[idx], dp[idx]));
			ans = Math.max(ans, dp[idx]);
		}
		out.println(ans);
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

}
