/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+:---test
3
10 40 70
20 50 80
30 60 90
---+/
/+:---test
1
100 10 1
---+/
/+---test
7
6 7 8
8 8 3
2 5 2
7 8 6
4 6 8
2 3 4
7 5 1
---+/

void main(string[] args) {
  const N = readln.chomp.to!long;

  auto days = new long[3][N];
  foreach (ref day; days) readf(" %d %d %d ", &day[0], &day[1], &day[2]);

  auto dp = new long[3][N+1];

  foreach (i; 0..N) {
    foreach (j, score; days[i]) {
      auto jo = tuple(0, 1);
      if (j == 0) jo = tuple(1, 2);
      if (j == 1) jo = tuple(0, 2);
      dp[i+1][j] = max(dp[i][jo[0]], dp[i][jo[1]]) + score;
    }
  }

  long ans;
  dp[$-1][].each!(x => ans = ans.max(x));
  ans.writeln;
}
