///              B I S M I L L A H I R  R A H M A N I R  R A H I M

#include<bits/stdc++.h>
using namespace std;
typedef bool                   boo;
typedef int                    li;
typedef long                   il;
typedef unsigned long          ul;
typedef long long int          ll;
typedef unsigned long long     ull;
typedef double                 dd;
typedef string                 str;
#define vli                    vector<li>
#define vll                    vector<ll>
#define sli                    set<li>
#define sll                    set<ll>
#define pli                    pair<li>
#define pll                    pair<ll>
#define vpi                    vector<pair<li, li>>
#define vpl                    vector<pair<ll, ll>>
#define mpl                    map<ll, ll>
#define wt                     ll t; cin>>t; while(t--)
#define input(a,n)             for(int i=0;i<n;i++) cin>>a[i];
#define lp(a, i, b)            for(ll i=a; i<b; i++)
#define rlp(a, i, b)           for(ll i=a; i>=b; i--)
#define sz(x)                  x.size()
#define len(z)                 z.begin(), z.end()
#define co(x)                  cout<<x nl
#define mem(z, l)              memset(z, l, sizeof(z))
#define MP                     make_pair
#define pb                     push_back
#define F                      first
#define S                      second
#define nl                     <<endl
#define nll                    cout<<endl
#define sp                     <<" "<<
#define sl                     <<" "
#define cy                     cout<<"YES"
#define cn                     cout<<"NO"
#define rn                     return
#define good_bye               return 0
#define PI                     3.1415926536
#define gcd(a,b)               __gcd(a,b)
#define lcm(a,b)               (a*(b/gcd(a,b)))
#define faster                 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define input_txt()            freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
const double eps=              1e-9;
const int inf=                 2000000000;
const ll infLL=                9000000000000000000;
//ll Pow(ll P, ll Q)           { ll R=1; for(ll I=1; I<=Q; I++) R*=P; rn R; }
//void dfs(ll K)               { vis[K]=true; for(auto J: v[K]) { if(!vis[J]) dfs(J); } }
//void seive(ll MX)            { S.pb(2); for(ll I=3; i<=MX; i+=2) { if(!vis[I]) { S.pb(I); for(ll J=I*I; j<=MX; J+=(2*I)) vis[J]=false; } } }
//bool isPrime(ll n)           { if(n%2==0) rn false; for(ll i=3; i*i<=n; i+=2) { if(n%i==0) rn false; } rn true; }
//----------------------------------------LET'S BEGIN-----------------------------------------------------------------------
const int mX = 1e5+123;
ll n, v[mX][4], dp[mX][4];

ll soln(ll day, ll work)
{
    if(day>n) rn 0;
    if(dp[day][work]!=-1) rn dp[day][work]; 
    ll s = 0;
    for(ll i=1; i<4; i++) if(i!=work) s = max(s, v[day][i]+soln(day+1, i));
    rn dp[day][work] = s;
}

void case_i()
{
    cin>>n;
    lp(1, i, n+1) cin>>v[i][1]>>v[i][2]>>v[i][3];
    mem(dp, -1);
    cout<<soln(1, 0) nl;
}

int main()
{
    faster;
//    input_txt();
//    wt
      case_i();
    good_bye;
}
///           _5_4_8_8_1_9_                ///



Measured memory_bytes: 17576