N = gets.to_i
abc = N.times.map{gets.split.map(&:to_i)}

dp = Array.new(N+1){Array.new(3, 0)}
N.times do |i|
    3.times do |j|
        3.times do |k|
            if j != k
                result = dp[i][j] + abc[i][k]
                dp[i+1][k] = result if dp[i+1][k] < result
            end
        end
    end
end

puts dp[N].max