//BISMILLAHIR-RAH-MANIR-RAHIM.
//ABU AYUB MD AHMADUL(CEO-PEREGRINE SPHERE).
//FORMER CEO-SPACEH(2019).
//DEPT.OF CSE,SUST//2018-19.
//------------------------------------------\\
//PRE-CODE========>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<math.h>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#define mp make_pair
#define ins insert
#define lli long long int
#define ll long long
#define pb push_back
#define loop1(i,l,n) for(i=l;i<=n;i++)
#define loop0(i,l,n) for(i=l;i<n;i++)
#define inf (1<<28)
set<int>ist;
map<string,int>msi;
map<string,string>mss;
map<int,string>mis;
map<int,int>mii;
vector<int>v;
vector<pair<int,int> >vv;
//------------------------------------------\\
//LAUNCHING FALCON-20========>
void LIFT_OFF_FALCON_JA20()
{
    int n,m,i,j,k,ans;
    cin>>n;
    int a[n+1]={};
    int b[n+1]={};
    int c[n+1]={};
    int dp[n+1][4]={};
    for(i=1;i<=n;i++)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    dp[1][1]=a[1];
    dp[1][2]=b[1];
    dp[1][3]=c[1];
    for(i=2;i<=n;i++)
    {
        dp[i][1]=max(dp[i-1][2],dp[i-1][3])+a[i];
        dp[i][2]=max(dp[i-1][1],dp[i-1][3])+b[i];
        dp[i][3]=max(dp[i-1][1],dp[i-1][2])+c[i];
    }
    ans=max(dp[n][1],max(dp[n][2],dp[n][3]));
    cout<<ans<<endl;


}
//MAIN FUNCTION========>
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    LIFT_OFF_FALCON_JA20();

    return 0;
}

//------------------------------------------\\
//ABOUT THE SERIES========>
//THE PEREGRINE FALCON SERIES-(JANUARY-2020).
//SPONSERED BY FASTEX AND SPAIT(CEO-SP).
//CONTROLLER=>NASRULLAH SAMI(CEO-FALCON AXIS).
//CO-CHIEF ADVISOR=>G.M NAYEEM(CEO-TECH FRIGATE).
//PRESIDENT=>NAIMUL ISLAM(CEO-QUANTAM SPACE).





/*
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gg(x) getInt(&x)
using namespace std;
typedef long long ll;
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
*/
/*** TEMPLATE CODE * * STARTS HERE ***/
/*
ll n;
ll a[maxn];
ll b[maxn];
ll c[maxn];
ll dp[maxn][5];

int main()
{
    gbtb;
    cin>>n;
    repd(i,1,n)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    dp[1][1]=a[1];
    dp[1][2]=b[1];
    dp[1][3]=c[1];
    repd(i,2,n)
    {
        dp[i][1]+=max(dp[i-1][2],dp[i-1][3])+a[i];
        dp[i][2]+=max(dp[i-1][1],dp[i-1][3])+b[i];
        dp[i][3]+=max(dp[i-1][1],dp[i-1][2])+c[i];
    }
    cout<<max(dp[n][3],max(dp[n][1],dp[n][2]));
    return 0;
}
*/
/*
inline void getInt(int* p) {
    char ch;
    do {
        ch = getchar();
    } while (ch == ' ' || ch == '\n');
    if (ch == '-') {
        *p = -(getchar() - '0');
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 - ch + '0';
        }
    }
    else {
        *p = ch - '0';
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 + ch - '0';
        }
    }
}
*/


Measured memory_bytes: 2944