n=gets.to_i
abc=n.times.map{gets.split.map(&:to_i)}
d=Array.new(n){Array.new(3,0)}
0.upto(2){|j| d[0][j]=abc[0][j]}
0.upto(n-2){|i|0.upto(2){|j|0.upto(2){|k|
  next if j==k
  d[i+1][k]=d[i][j]+abc[i+1][k] if d[i+1][k]<d[i][j]+abc[i+1][k]
}}}
puts d[n-1].max