N = gets.to_i

a = Array.new(3){Array.new(N+1)}

for i in 1..N do
  a[0][i], a[1][i], a[2][i] = gets.split.map(&:to_i)
end

dp = Array.new(N+1){Array.new(3)}

dp[1][0] = a[0][1]
dp[1][1] = a[1][1]
dp[1][2] = a[2][1]

for i in 2..N do
  for j in 0..2 do
    max = -Float::INFINITY

    for k in 0..2 do
      next if k==j
      gain = dp[i-1][k] + a[j][i]

      if gain > max
        max = gain
      end

    end

    dp[i][j] = max
  end
end

puts [dp[N][0], dp[N][1], dp[N][2]].max
