#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
int main() {
  int H, W;
  cin >> H >> W;
  string S[H][W];
  int num = 0;
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j > W; ++j) {
      cin >> S[i][j];
    }
  }
  int ans = 0;
  int pos_x = 0, pos_y = 0;
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      pos_x = j;
      pos_y = i;
      num = 0;
      while (S[pos_y][pos_x] != "#") {
        if (S[pos_y + 1][pos_x] != "#") {
          ++pos_y;
          ++num;
        } else {
          if (S[pos_y][pos_x + 1] != "#") {
            ++pos_x;
            ++num;
          }
        }
      }
      ans = max(ans, num);
    }
  }
  cout << ans;
}
