def max(a, b)
  a > b ? a : b
end
N = gets.to_i
ABC = N.times.map{gets.split.map(&:to_i)}

dp = Array.new(N){Array.new(3, 0)}

dp[0] = ABC[0]
1.upto(N - 1) do |i|
  3.times do |j|
    3.times do |nj|
      next if j == nj
      dp[i][nj] = max(dp[i][nj], dp[i - 1][j] + ABC[i][nj])
    end
  end
end
p dp[N - 1].max