#include #include using namespace std; int mat[105][105]; int main() { int n, m, i, j, max = 0; char c; scanf("%d%d\n", &n, &m); for(i = 1; i <= n; ++ i) { for(j = 1; j <= m; ++ j) { scanf("%c", &c); if(c != '&') { mat[i][j] = mat[i-1][j]; if(mat[i][j] < mat[i][j-1]) mat[i][j] = mat[i][j - 1]; ++ mat[i][j]; if(max < mat[i][j]) max = mat[i][j]; } } scanf("\n"); } printf("%d\n", max); return 0; }