Problem: As the league stage of the world cup has come to its end, its time to calculate the highest points earned in the league stage by a team. 
There are many teams playing in the world cup. A team is awarded 3 points for a win, 1 point for a tie and it loses 1 point if they lose a match.  You have received data of N  teams and have been assigned the duty to calculate the highest point earned by a team among the N  teams in the league stage. For each team, data contains three integers – W ( number of wins), T (number of tie), L (number of matches the team lost).  Now, calculate the highest points earned by a team in the league stage among the N teams.
INPUT:
First line contains a integer N, number of teams.
 Next N lines contains three integers separated by space :  W T L , number of wins, tie, lost matches for that ith team. (1 ≤ i ≤ N)
OUTPUT:
print a single integer , highest points earned a team among the N teams.

CONSTRAINS
1 ≤ N ≤ 1000
0 ≤ W,T,L ≤ 100

Disclaimer : All the data are fictional and has no relation and significance with real life.

SAMPLE INPUT
3
3 0 1
2 1 3
1 1 1

SAMPLE OUTPUT
8

Explanation

Team 1 =  (3x3) + (0x1) + (1x-1) = 8
Team 2 = (2x3) + (1x1) + (3x-1) = 4
Team 3 = (1x3)  +  (1x1)  +  (1x-1) = 3
So the highest point earned by any team is 8.

Solution (in PYTHON):

Solution:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t = input()
ans = -100000000000000
for i in range(0,t):
	a,b,c = map(int, raw_input().split())
	score = 3*a+b-c
	if ans < score:
		ans = score
print ans