// Slower C++ solution:
/*

██╗  ██╗ █████╗ ██████╗ ███████╗███████╗███╗   ███╗        ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗

██║ ██╔╝██╔══██╗██╔══██╗██╔════╝██╔════╝████╗ ████║        ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗

█████╔╝ ███████║██████╔╝█████╗  █████╗  ██╔████╔██║        █████╔╝ ███████║███████║██║     █████╗  ██║  ██║

██╔═██╗ ██╔══██║██╔══██╗██╔══╝  ██╔══╝  ██║╚██╔╝██║        ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║

██║  ██╗██║  ██║██║  ██║███████╗███████╗██║ ╚═╝ ██║███████╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝

╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝

Believe in yourself ,( try and try and then try ), You can do it 

*/

#define _CRT_SECURE_NO_WARNINGS

#include<bits/stdc++.h>

#include<unordered_map>

#define endl "\n"

#define Ceil(x,y) ((x+y-1)/y)

#define clr(arr, x) memset(arr, x, sizeof arr)

#define all(v) v.begin(),v.end()

#define allr(s) s.rbegin(),s.rend()

#define rt(s) return cout<<s,0

#define watch(x) cout<<(#x)<<" = "<<x<<endl

#define sz(s)	(int)(s.size())

#define OO 0x3f3f3f3f3f3f3f3fLL

const int oo = 0x3f3f3f3f, mod = 1e9 + 7;

using namespace std;

typedef long long ll;

typedef long double ld;

typedef unsigned long long ull;

//x = xDegrees*3.14159265 / 180;

//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);

//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));

int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };

int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };

void K_K(){

#ifndef ONLINE_JUDGE

//	freopen("in.txt", "r", stdin);

//	freopen("out.txt", "w", stdout);

#endif  !ONLINEJUDGE

	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

}

ll gcd(ll a, ll b) {

	return b == 0 ? abs(a) : gcd(b, a % b);

}

ll lcm(ll a, ll b) {

	return a / gcd(a, b) * b;

}

int n;

vector<int>a, b, c;

int dp[100005][5];

int sol(int idx, int pre){

	if (idx == n)

		return 0;

	int& ret = dp[idx][pre];

	if (~ret)

		return ret;

	int ch1 = 0, ch2 = 0, ch3 = 0;

	if (pre != 1)

		ch1 = sol(idx + 1, 1) + a[idx];

	if (pre != 2)

		ch2 = sol(idx + 1, 2) + b[idx];

	if (pre != 3)

		ch3 = sol(idx + 1, 3) + c[idx];

	return ret = max({ ch1, ch2, ch3 });

}

int main(){

	K_K();

	cin >> n;

	a.resize(n);

	b.resize(n);

	c.resize(n);

	clr(dp, -1);

	for (int i = 0; i < n; i++)

		cin >> a[i] >> b[i] >> c[i];

	cout << sol(0, 0);

}

// Faster C++ solution for the same problem (measured speedup: 3.0149919433064647x):
#include <bits/stdc++.h>

using namespace std;

#define INF 2000000000

typedef long long int ll;

typedef pair<ll,ll> ii;

typedef vector<ll> vi;

typedef vector<ii> vii;

#define getbit(n,i) (((n)&(1<<(i)))!=0)

#define setbit0(n,i) ((n)&(~(1<<(i))))

#define setbit1(n,i) ((n)(1<<(i)))

#define togglebit(n,i) ((n)^(1<<(i)))

#define lastone(n) ((n)&(-(n)))

#define read freopen("debug\\in.txt","r",stdin)

#define write freopen("debug\\out.txt","w",stdout)

#define fi first

#define se second

#define getI(a) scanf("%d",&a)

#define getII(a,b) scanf("d",&a,&b)

#define PI (acos(-1))

#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL)

#define mod (1000000007)

#define asz 500005

#define t int t;scanf("%d",&t);for(int v=1;v<=t;v++)

#define loop_arr(i,a,b) for(int i=a;i<b;i++)

#define loop_norm(i,a,b) for(int i=a;i<=b;i++)

#define minheap priority_queue<int,vector<int>,greater<int> >

#define maaheap priority_queue<int>

#define pb push_back

#define newl "\n"

ll BIGMOD ( ll a, ll p, ll m )

{

    ll result = 1;

    ll x = a;



    while ( p )

    {

        if ( p & 1 ) //p is odd

        {

            result = ( result * x ) % m;

        }

        x = ( x * x ) % m;

        p = p >> 1;

    }



    return result;

}



bool isPrime(int n)

{

    if (n <= 1)  return false;

    if (n <= 3)  return true;

    if (n%2 == 0 || n%3 == 0) return false;



    for (int i=5; i*i<=n; i=i+6)

        if (n%i == 0 || n%(i+2) == 0)

           return false;



    return true;

}



void SieveOfEratosthenes(int n)

{

    bool prime[n+1];

    memset(prime, true, sizeof(prime));



    for (int p=2; p*p<=n; p++)

    {



        if (prime[p] == true)

        {

            for (int i=p*p; i<=n; i += p)

                prime[i] = false;

        }

    }

}

const int MAX=100005;

ll memo[MAX][3];

 int arr[MAX][3];

 int n;

 void init()

 {

     for(int i=0;i<=n;i++)

     {

         for(int j=0;j<3;j++) memo[i][j]=-1;

     }

 }

ll vacation(int i,char current)

{

    if(i==n) return 0;

    if(memo[i][current-'A']!=-1) return memo[i][current-'A'];

    if(current=='A')

    {

        ll res1=arr[i][0]+vacation(i+1,'B');

        ll res2=arr[i][0]+vacation(i+1,'C');

        return memo[i][0]=max(res1,res2);

    }

    if(current=='B')

    {

        ll res1=arr[i][1]+vacation(i+1,'A');

        ll res2=arr[i][1]+vacation(i+1,'C');

        return memo[i][1]=max(res1,res2);

    }

    if(current=='C')

    {

        ll res1=arr[i][2]+vacation(i+1,'A');

        ll res2=arr[i][2]+vacation(i+1,'B');

        return memo[i][2]=max(res1,res2);

    }





}



int main()

{

  // fastread;

   cin>>n;

   init();

   for(int i=0;i<n;i++)

   {

       for(int j=0;j<3;j++) cin>>arr[i][j];

   }

   ll res1=vacation(0,'A');

   ll res2=vacation(0,'B');

   ll res3=vacation(0,'C');

   cout<<max(res1,max(res2,res3))<<newl;

  return 0;

}