lines = $stdin.read
array = lines.split("\n")
N = array[0].to_i
H = array[1].split(" ").map(&:to_i)
Item = Struct.new(:a, :b, :c)

items = [Item.new(0,0,0)]
array[1..N].each do |s|
  item = Item.new
  item.a, item.b, item.c = s.split(" ").map(&:to_i)
  items << item
end

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

for i in 1...N+1
  for j in 0...3
    dp[i][j] = [
      dp[i-1][1] + items[i].a, dp[i-1][2] + items[i].a
    ].max if j==0
    dp[i][j] = [
      dp[i-1][0] + items[i].b, dp[i-1][2] + items[i].b
    ].max if j==1
    dp[i][j] = [
      dp[i-1][0] + items[i].c, dp[i-1][1] + items[i].c
    ].max if j==2
  end
end

#dp.each{|l| p l}
puts dp.max.max