from typing import Sequence


def solve(N: int, a: Sequence[int], b: Sequence[int], c: Sequence[int]) -> int:
    dp = [[0, 0, 0] for _ in range(N + 1)]
    for i in range(1, N + 1):
        dp[i][0] = a[i - 1] + max(dp[i - 1][1], dp[i - 1][2])
        dp[i][1] = b[i - 1] + max(dp[i - 1][0], dp[i - 1][2])
        dp[i][2] = c[i - 1] + max(dp[i - 1][0], dp[i - 1][1])
    return max(dp[N][0], dp[N][1], dp[N][2])


N = int(input())
print(solve(N, *zip(*(map(int, input().split()) for _ in range(N)))))
