"use strict";
function Main(input) {
    let lines = input.split("\n");
    let N = lines.shift() - 0;
    let abc = new Array(N+1);
    for (let n = 0; n < N; n++) {
        abc[n] = lines.shift().split(/\s/).map((v) => v - 0);
    }
    let dp = new Array(N + 1).fill(0).map((v) => [0, 0, 0]);
    for (let n = 0; n < N; n++)
        for (let j = 0; j < 3; j++)
            for (let k = 0; k < 3; k++)
                if (k != j) dp[n + 1][k] = Math.max(dp[n + 1][k], dp[n][j] + abc[n][k]);
    console.log(Math.max(...dp[N]));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));