#include #include #include #include #include using namespace std; int N, M; int A[102][102], D[102][102]; char s[105]; int main() { //freopen("data.in", "r", stdin); scanf("%d %d", &N, &M); for(int i = 1; i <= N; ++i) { scanf("%s", &s); for(int j = 0; j < M; ++j) if(s[j] == '.') A[i][j + 1] = 1; } int sol = 0; for(int i = 1; i <= N; ++i) for(int j = 1; j <= M; ++j) if(A[i][j] == 1) { D[i][j] = 1 + max(D[i - 1][j], D[i][j - 1]); if(D[i][j] == i + j - 1) sol = max(sol, D[i][j]); } printf("%d\n", sol); return 0; }