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.
//make sure to make new file!
import java.io.*;
import java.util.*;
//basic convex hull trick, lines and queries are sorted
//blog https://codeforces.com/blog/entry/63823
public class E1083{
   
   public static void main(String[] args)throws IOException{
      BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
      PrintWriter out = new PrintWriter(System.out);
      
      int n = Integer.parseInt(f.readLine());
      
      Rect[] rects = new Rect[n];
      for(int k = 0; k < n; k++){
         StringTokenizer st = new StringTokenizer(f.readLine());
         
         long x = Long.parseLong(st.nextToken());
         long y = Long.parseLong(st.nextToken());
         long a = Long.parseLong(st.nextToken());
         
         rects[k] = new Rect(x,y,a);
      }
      
      Arrays.sort(rects);
      /*
      for(int k = 0; k < n; k++){
         out.println(rects[k].x);
      }*/
      long[] dp = new long[n];
      
      Deque<Line> dq = new LinkedList<Line>();
      dq.addFirst(new Line(0L,0L));
      
      long answer = 0L;
      for(int k = 0; k < n; k++){
         //query (you can remove lines because the queries are in sorted order)
         while(dq.size() >= 2){
            Line last = dq.pollLast();
            Line last2 = dq.pollLast();
            
            //out.println(rects[k].x);
            //out.println(last + ": " + last.eval(rects[k].x));
            //out.println(last2 + ": " + last2.eval(rects[k].x));
            if(last.eval(rects[k].y) <= last2.eval(rects[k].y)){
               //out.println("Remove " + last);
               
               dq.addLast(last2);
            } else {
               dq.addLast(last2);
               dq.addLast(last);
               break;
            }
         }
         
         //use last
         //out.println(dq.peekLast());
         dp[k] = rects[k].x*rects[k].y-rects[k].a + dq.peekLast().eval(rects[k].y);
         //out.println(dp[k]);
         answer = Math.max(answer,dp[k]);
         
         //insert
         Line add = new Line(-1*rects[k].x,dp[k]);
         while(dq.size() >= 2){
            Line first = dq.pollFirst();
            Line first2 = dq.pollFirst();
            
            if(add.intersectionX(first) >= first.intersectionX(first2)){
               //out.println(first);
               dq.addFirst(first2);
            } else {
               dq.addFirst(first2);
               dq.addFirst(first);
               break;
            }
         }
         //out.println(add);
         dq.addFirst(add);
      }
      
      out.println(answer);
         
      
      
      
      
      
      
      out.close();
   }
   
   public static class Line{
      //y=mx+c
      long m;
      long c;
      public Line(long a, long b){
         m = a;
         c = b;
      }
      public long eval(long x){
         return m*x+c;
      }
      //returns x value of intersection (doesn't handle parallel)
      public double intersectionX(Line l){
         return ((double)(l.c-c))/((double)(m-l.m));
      }
      public String toString(){
         return m + " " + c;
      }
         
   }
   
   public static class Rect implements Comparable<Rect>{
      long x;
      long y;
      long a;
      public Rect(long q, long w, long e){
         x = q;
         y = w;
         a = e;
      }
      //sort by x
      public int compareTo(Rect r){
         if(x > r.x) 
            return 1;
         else if(x < r.x) 
            return -1;
         return 0;
      }
   }
   
   
   
      
}