N=gets.to_i
b=N.times.map{gets.split.map(&:to_i)}.transpose
dp=Array.new(N){Array.new(3,-1)}
dp[0][0]=b[0][0]
dp[0][1]=b[1][0]
dp[0][2]=b[2][0]
for i in 1..N-1#date
    for j in 0..2#todaychice
        for k in 0..2#yesterdaychoice
            if j==k
                next
            end
            l=dp[i-1][k]+b[j][i]
            dp[i][j]=(l > dp[i][j] ? l : dp[i][j])
        end
    end
end
puts [dp[N-1][0],dp[N-1][1],dp[N-1][2]].max