N = gets.to_i
ABC = readlines.map { |abc| abc.split.map(&:to_i) }
happy = []

N.times do |i|
  if i == 0
    happy << ABC[0]
  else
    tmp_a = happy[i - 1][1, 2].max + ABC[i][0]
    tmp_b = [happy[i - 1][0], happy[i - 1][2]].max + ABC[i][1]
    tmp_c = happy[i - 1][0, 2].max + ABC[i][2]
    happy << [tmp_a, tmp_b, tmp_c]
  end
end

puts happy[-1].max