Public Class Program
  Shared Sub Main()
    Dim n As Long = Long.Parse(Console.ReadLine())
    ' 0 = a, 1 = b, 2 = c '
    Dim dp(0 To n, 0 To 2) As Long
    dp(0, 0) = 0
    dp(0, 1) = 0
    dp(0, 2) = 0
    For i As Long = 1 To n
      Dim abc As Long() = Array.ConvertAll(Of String, Long)(Console.ReadLine().Split(" "), AddressOf Long.Parse)
      Dim a As Long = abc(0)
      Dim b As Long = abc(1)
      Dim c As Long = abc(2)
      dp(i, 0) = Math.Max(dp(i - 1, 1), dp(i - 1, 2)) + a
      dp(i, 1) = Math.Max(dp(i - 1, 2), dp(i - 1, 0)) + b
      dp(i, 2) = Math.Max(dp(i - 1, 0), dp(i - 1, 1)) + c
    Next
    Dim output As Long = Math.Max(dp(n, 0), Math.Max(dp(n, 1), dp(n, 2)))
    Console.WriteLine(output.ToString())
  End Sub
End Class