h, w = map(int, input().split())
s = []
for _ in range(h):
    s.append(input())
lis_row = [[0 for j in range(w)] for i in range(h)]
lis_column = [[0 for j in range(w)] for i in range(h)]
for i in range(h):
    tmp = 0
    lis = []
    for j in range(w):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
    now = 0
    for j in range(w-1, -1, -1):
        if lis[j] != 0:
            now = max(lis[j], now)
            lis_row[i][j] = now
        else:
            now = 0

for j in range(w):
    tmp = 0
    lis = []
    for i in range(h):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
    now = 0
    for i in range(h-1, -1, -1):
        if lis[i] != 0:
            now = max(lis[i], now)
            lis_column[i][j] = now
        else:
            now = 0
ans = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            ans = max(ans, lis_row[i][j] + lis_column[i][j] -1)
print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w s = [] s [] for _ in range(h):
    s.append(input()) _ range(h) range h s.append(input()) s.append s append input() input [0 for j in range(w)] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0 for j in range(w)] lis_row = [[0 for j in range(w)] for i in range(h)] lis_row [[0 for j in range(w)] for i in range(h)] [0 for j in range(w)] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0 for j in range(w)] lis_column = [[0 for j in range(w)] for i in range(h)] lis_column [[0 for j in range(w)] for i in range(h)] for i in range(h):
    tmp = 0
    lis = []
    for j in range(w):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
    now = 0
    for j in range(w-1, -1, -1):
        if lis[j] != 0:
            now = max(lis[j], now)
            lis_row[i][j] = now
        else:
            now = 0 i range(h) range h tmp = 0 tmp 0 lis = [] lis [] for j in range(w):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
     j range(w) range w if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
     s[i][j] == "#" s[i][j] [i] s i j "#" lis.append(0) lis.append lis append 0 tmp = 0 tmp 0 tmp += 1 tmp 1 lis.append(tmp) lis.append lis append tmp now = 0 now 0 for j in range(w-1, -1, -1):
        if lis[j] != 0:
            now = max(lis[j], now)
            lis_row[i][j] = now
        else:
            now = 0 j range(w-1, -1, -1) range w-1 w 1 -1 -1 if lis[j] != 0:
            now = max(lis[j], now)
            lis_row[i][j] = now
        else:
            now = 0 lis[j] != 0 lis[j] lis j 0 now = max(lis[j], now) now max(lis[j], now) max lis[j] lis j now lis_row[i][j] = now lis_row[i][j] [i] lis_row i j now now = 0 now 0 for j in range(w):
    tmp = 0
    lis = []
    for i in range(h):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
    now = 0
    for i in range(h-1, -1, -1):
        if lis[i] != 0:
            now = max(lis[i], now)
            lis_column[i][j] = now
        else:
            now = 0 j range(w) range w tmp = 0 tmp 0 lis = [] lis [] for i in range(h):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
     i range(h) range h if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
     s[i][j] == "#" s[i][j] [i] s i j "#" lis.append(0) lis.append lis append 0 tmp = 0 tmp 0 tmp += 1 tmp 1 lis.append(tmp) lis.append lis append tmp now = 0 now 0 for i in range(h-1, -1, -1):
        if lis[i] != 0:
            now = max(lis[i], now)
            lis_column[i][j] = now
        else:
            now = 0 i range(h-1, -1, -1) range h-1 h 1 -1 -1 if lis[i] != 0:
            now = max(lis[i], now)
            lis_column[i][j] = now
        else:
            now = 0 lis[i] != 0 lis[i] lis i 0 now = max(lis[i], now) now max(lis[i], now) max lis[i] lis i now lis_column[i][j] = now lis_column[i][j] [i] lis_column i j now now = 0 now 0 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            ans = max(ans, lis_row[i][j] + lis_column[i][j] -1) i range(h) range h for j in range(w):
        if s[i][j] == ".":
            ans = max(ans, lis_row[i][j] + lis_column[i][j] -1) j range(w) range w if s[i][j] == ".":
            ans = max(ans, lis_row[i][j] + lis_column[i][j] -1) s[i][j] == "." s[i][j] [i] s i j "." ans = max(ans, lis_row[i][j] + lis_column[i][j] -1) ans max(ans, lis_row[i][j] + lis_column[i][j] -1) max ans lis_row[i][j] + lis_column[i][j] -1 lis_row[i][j] + lis_column[i][j] lis_row[i][j] [i] lis_row i j lis_column[i][j] [i] lis_column i j 1 print(ans) print ans now = max(lis[j], now) max(lis[j], now) now s = [] [] s lis_column = [[0 for j in range(w)] for i in range(h)] [[0 for j in range(w)] for i in range(h)] lis_column h, w = map(int, input().split()) map(int, input().split()) h w = map(int, input().split()) map(int, input().split()) w lis = [] [] lis tmp = 0 0 tmp tmp += 1 1 tmp now = 0 0 now now = 0 0 now lis_row = [[0 for j in range(w)] for i in range(h)] [[0 for j in range(w)] for i in range(h)] lis_row tmp = 0 0 tmp now = 0 0 now ans = max(ans, lis_row[i][j] + lis_column[i][j] -1) max(ans, lis_row[i][j] + lis_column[i][j] -1) ans tmp = 0 0 tmp lis = [] [] lis now = max(lis[i], now) max(lis[i], now) now now = 0 0 now tmp = 0 0 tmp ans = 0 0 ans tmp += 1 1 tmp
h, w = map(int, input().split())
s = []
for _ in range(h):
    s.append(input())
lis_row = [[0 for j in range(w)] for i in range(h)]
lis_column = [[0 for j in range(w)] for i in range(h)]
for i in range(h):
    tmp = 0
    lis = []
    for j in range(w):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
    now = 0
    for j in range(w-1, -1, -1):
        if lis[j] != 0:
            now = max(lis[j], now)
            lis_row[i][j] = now
        else:
            now = 0

for j in range(w):
    tmp = 0
    lis = []
    for i in range(h):
        if s[i][j] == "#":
            lis.append(0)
            tmp = 0
        else:
            tmp += 1
            lis.append(tmp)
    now = 0
    for i in range(h-1, -1, -1):
        if lis[i] != 0:
            now = max(lis[i], now)
            lis_column[i][j] = now
        else:
            now = 0
ans = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            ans = max(ans, lis_row[i][j] + lis_column[i][j] -1)
print(ans)