n=io.read"*n"
a,b,c={},{},{}for i=1,n do
a[i]=io.read"*n"
b[i]=io.read"*n"
c[i]=io.read"*n"end

dp={{a[1],b[1],c[1]}}
for i=2,n do dp[i]={}end

for i=2,n do
dp[i][1]=math.max(dp[i-1][2],dp[i-1][3])+a[i]
dp[i][2]=math.max(dp[i-1][3],dp[i-1][1])+b[i]
dp[i][3]=math.max(dp[i-1][1],dp[i-1][2])+c[i]
end
print(math.max(dp[n][1],dp[n][2],dp[n][3]))