#include <bits/stdc++.h>
using namespace std;
long long inf = 1e18 + 9;
long long h, w, a[210][210], dp[210][210], dx[2] = {0, 1}, dy[2] = {1, 0},
                                           ans = 0;
long long f(long long x, long long y) {
  long long ans = 0;
  for (int i = 0; i < ((int)(2)); i++) {
    if (x + dx[i] > w - 1 || y + dy[i] > h - 1) continue;
    ans = max(ans, f(x + dx[i], y + dy[i]));
  }
  return dp[y][x] = ans + a[y][x];
}
void g(long long x, long long y) {
  while (1) {
    a[y][x] = 0;
    if (x == w - 1 && y == h - 1) break;
    long long b = 0, to = 0;
    for (int i = 0; i < ((int)(2)); i++) {
      if (x + dx[i] > w - 1 || y + dy[i] > h - 1) continue;
      if (dp[y + dy[i]][x + dx[i]] > b) {
        to = i;
        b = dp[y + dy[i]][x + dx[i]];
      }
    }
    x = x + dx[to];
    y = y + dy[to];
  }
}
void dp_reset() {
  for (int i = 0; i < ((int)(210)); i++)
    for (int j = 0; j < ((int)(210)); j++) dp[i][j] = -1;
}
int main(void) {
  cin >> h >> w;
  for (int i = 0; i < ((int)(h)); i++)
    for (int j = 0; j < ((int)(w)); j++) cin >> a[i][j];
  dp_reset();
  ans += f(0, 0);
  g(0, 0);
  dp_reset();
  ans += f(0, 0);
  cout << ans << endl;
  return 0;
}
