n = gets.to_i
abc = (1..n).map{|x| gets.split.map(&:to_i) }

result = abc.inject([0,0,0]) {|m,x|
  [
    [m[1],m[2]].max + x[0],
    [m[0],m[2]].max + x[1],
    [m[0],m[1]].max + x[2]
  ]
}.max

puts result
