function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let N = parseInt(input[0][0], 10);
    let arr_abc = [];
    for (let i = 0; i < N; i++){
        arr_abc.push(input[i + 1].map(e => parseInt(e, 10)));
    }

    let DP = [arr_abc[0]];

    for (let i = 1; i < N; i++){
        DP.push([]);
        DP[i][0] = Math.max(DP[i - 1][1], DP[i - 1][2]) + arr_abc[i][0];
        DP[i][1] = Math.max(DP[i - 1][0], DP[i - 1][2]) + arr_abc[i][1];
        DP[i][2] = Math.max(DP[i - 1][0], DP[i - 1][1]) + arr_abc[i][2];
    }

    console.log(Math.max(DP[N - 1][0], DP[N - 1][1], DP[N - 1][2]));

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
