#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
template <typename T>
T gcd(T a, T b) {
  return (a == 0) ? b : gcd(b % a, a);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
bool p_comp_fs(const pair<long long, long long> p1,
               const pair<long long, long long> p2) {
  return p1.first < p2.first;
};
bool p_comp_fg(const pair<long long, long long> p1,
               const pair<long long, long long> p2) {
  return p1.first > p2.first;
};
bool p_comp_ss(const pair<long long, long long> p1,
               const pair<long long, long long> p2) {
  return p1.second < p2.second;
};
bool p_comp_sg(const pair<long long, long long> p1,
               const pair<long long, long long> p2) {
  return p1.second > p2.second;
};
template <typename T>
vector<T> uniquen(vector<T> vec) {
  sort((vec).begin(), (vec).end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  return vec;
}
inline long long popcnt(long long x) {
  return __builtin_popcountll((unsigned long long)x);
};
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
bool bit(long long st, long long b) { return ((st >> b) & 1) == 1; }
long long H, W;
long long dp[210][210][420];
vector<vector<long long> > A;
vector<long long> dh = {1, 0};
bool ok(long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }
void dfs(long long eh, long long sh, long long sum, long long now) {
  if (dp[eh][sh][sum] > now) return;
  if (sum == H - 1 + W - 1) return;
  for (long long i = 0; i < 2; i++)
    for (long long j = 0; j < 2; j++) {
      long long nhe = eh + dh[i], nwe = sum + 1 - nhe;
      long long nhs = sh + dh[j], nws = sum + 1 - nhs;
      if (!ok(nhe, nwe) || !ok(nhs, nws)) continue;
      if (nhe == nhs && nwe == nws) {
        if (chmax(dp[nhe][nhs][sum + 1], now + A[nhe][nwe])) {
          dfs(nhe, nhs, sum + 1, now + A[nhe][nwe]);
        }
      } else {
        if (chmax(dp[nhe][nhs][sum + 1], now + A[nhe][nwe] + A[nhs][nws])) {
          dfs(nhe, nhs, sum + 1, now + A[nhe][nwe] + A[nhs][nws]);
        }
      }
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  memset(dp, -1, sizeof(dp));
  cin >> H >> W;
  A = vector<vector<long long> >(H, vector<long long>(W, 0));
  for (long long i = 0; i < H; i++)
    for (long long j = 0; j < W; j++) cin >> A[i][j];
  dp[0][0][0] = 0;
  dfs(0, 0, 0, A[0][0]);
  cout << dp[H - 1][H - 1][H - 1 + W - 1] << endstr;
  return 0;
}
