N = gets.to_i
abc = Array.new(N)
N.times do |i|
  abc[i] = gets.split.map(&:to_i)
end

dp = Array.new(N)
dp[0] = [0,0,0]

(1..N).each do |i|
  dp[i] = []
  dp[i][0] = abc[i-1][0] + (dp[i-1][1] < dp[i-1][2] ? dp[i-1][2] : dp[i-1][1])
  dp[i][1] = abc[i-1][1] + (dp[i-1][2] < dp[i-1][0] ? dp[i-1][0] : dp[i-1][2])
  dp[i][2] = abc[i-1][2] + (dp[i-1][0] < dp[i-1][1] ? dp[i-1][1] : dp[i-1][0])
end

puts dp[N].max
