n=gets.to_i
$abc=[]
n.times do|i|
	$abc[i]=gets.chomp.split(" ").map(&:to_i)
end
def cal(flag,n)
	dp=Array.new(n)
	dp[0]=$abc[0][flag]
	for i in 1..n-1
		max=0
		tmp_flg=-1
		for j in 0..2
			if j==flag
				next
			end
			result=dp[i-1]+$abc[i][j]
			if(max<result)
				max=result
				tmp_flg=j
			end
		end
		flag=tmp_flg
		dp[i]=max
	end
	return dp[n-1]
end
res1=cal(0,n)
res2=cal(1,n)
res3=cal(2,n)
if(res1>res2 and res1>res3)
	p res1
elsif (res2>res1 and res2>res3)
	p res2
else
	p res3
end