# coding: utf-8
N = gets.to_i
abc = []
N.times do |i|
  abc << gets.split.map {|e| e.to_i}
end

#INF = 10 ** 4 + 10
#p INF
dp = Array.new(100010) { Array.new(3, 0) }

N.times do |i|
  3.times do |j|
    3.times do |k|
      next if j == k
      dp[i+1][k] = dp[i][j] + abc[i][k] if dp[i+1][k] < dp[i][j] + abc[i][k]
    end
  end
end

ans = 0
3.times do |i|
  ans = dp[N][i] if ans < dp[N][i]
end
puts ans
