h, w = map(int, input().split())
S = [[] for _ in range(h)]
for i in range(h):
    S[i] = list(input())

ans = 0
L = [[0]*w for _ in range(h)]
for hi in range(h):
    cnt = 1
    for wi in range(w):
        if S[hi][wi]=='#':
            L[hi][wi] = 0
            cnt = 1
        else:
            L[hi][wi] = cnt
            cnt += 1

R = [[0]*w for _ in range(h)]
for hi in range(h):
    cnt = 1
    for wi in range(w):
        if S[hi][w-wi-1]=='#':
            R[hi][w-wi-1] = 0
            cnt = 1
        else:
            R[hi][w-wi-1] = cnt
            cnt += 1

D = [[0]*w for _ in range(h)]
for wi in range(w):
    cnt = 1
    for hi in range(h):
        if S[hi][wi]=='#':
            D[hi][wi] = 0
            cnt = 1
        else:
            D[hi][wi] = cnt
            cnt += 1

U = [[0]*w for _ in range(h)]
for wi in range(w):
    cnt = 1
    for hi in range(h):
        if S[h-hi-1][wi] == '#':
            U[h-hi-1][wi] = 0
            cnt = 1
        else:
            U[h-hi-1][wi] = cnt
            cnt += 1

ans = 0
for hi in range(h):
    for wi in range(w):
        ans = max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3)
print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w [] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [] S = [[] for _ in range(h)] S [[] for _ in range(h)] for i in range(h):
    S[i] = list(input()) i range(h) range h S[i] = list(input()) S[i] S i list(input()) list input() input ans = 0 ans 0 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w L = [[0]*w for _ in range(h)] L [[0]*w for _ in range(h)] for hi in range(h):
    cnt = 1
    for wi in range(w):
        if S[hi][wi]=='#':
            L[hi][wi] = 0
            cnt = 1
        else:
            L[hi][wi] = cnt
            cnt += 1 hi range(h) range h cnt = 1 cnt 1 for wi in range(w):
        if S[hi][wi]=='#':
            L[hi][wi] = 0
            cnt = 1
        else:
            L[hi][wi] = cnt
            cnt += 1 wi range(w) range w if S[hi][wi]=='#':
            L[hi][wi] = 0
            cnt = 1
        else:
            L[hi][wi] = cnt
            cnt += 1 S[hi][wi]=='#' S[hi][wi] [hi] S hi wi '#' L[hi][wi] = 0 L[hi][wi] [hi] L hi wi 0 cnt = 1 cnt 1 L[hi][wi] = cnt L[hi][wi] [hi] L hi wi cnt cnt += 1 cnt 1 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w R = [[0]*w for _ in range(h)] R [[0]*w for _ in range(h)] for hi in range(h):
    cnt = 1
    for wi in range(w):
        if S[hi][w-wi-1]=='#':
            R[hi][w-wi-1] = 0
            cnt = 1
        else:
            R[hi][w-wi-1] = cnt
            cnt += 1 hi range(h) range h cnt = 1 cnt 1 for wi in range(w):
        if S[hi][w-wi-1]=='#':
            R[hi][w-wi-1] = 0
            cnt = 1
        else:
            R[hi][w-wi-1] = cnt
            cnt += 1 wi range(w) range w if S[hi][w-wi-1]=='#':
            R[hi][w-wi-1] = 0
            cnt = 1
        else:
            R[hi][w-wi-1] = cnt
            cnt += 1 S[hi][w-wi-1]=='#' S[hi][w-wi-1] [hi] S hi w-wi-1 w-wi w wi 1 '#' R[hi][w-wi-1] = 0 R[hi][w-wi-1] [hi] R hi w-wi-1 w-wi w wi 1 0 cnt = 1 cnt 1 R[hi][w-wi-1] = cnt R[hi][w-wi-1] [hi] R hi w-wi-1 w-wi w wi 1 cnt cnt += 1 cnt 1 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w D = [[0]*w for _ in range(h)] D [[0]*w for _ in range(h)] for wi in range(w):
    cnt = 1
    for hi in range(h):
        if S[hi][wi]=='#':
            D[hi][wi] = 0
            cnt = 1
        else:
            D[hi][wi] = cnt
            cnt += 1 wi range(w) range w cnt = 1 cnt 1 for hi in range(h):
        if S[hi][wi]=='#':
            D[hi][wi] = 0
            cnt = 1
        else:
            D[hi][wi] = cnt
            cnt += 1 hi range(h) range h if S[hi][wi]=='#':
            D[hi][wi] = 0
            cnt = 1
        else:
            D[hi][wi] = cnt
            cnt += 1 S[hi][wi]=='#' S[hi][wi] [hi] S hi wi '#' D[hi][wi] = 0 D[hi][wi] [hi] D hi wi 0 cnt = 1 cnt 1 D[hi][wi] = cnt D[hi][wi] [hi] D hi wi cnt cnt += 1 cnt 1 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w U = [[0]*w for _ in range(h)] U [[0]*w for _ in range(h)] for wi in range(w):
    cnt = 1
    for hi in range(h):
        if S[h-hi-1][wi] == '#':
            U[h-hi-1][wi] = 0
            cnt = 1
        else:
            U[h-hi-1][wi] = cnt
            cnt += 1 wi range(w) range w cnt = 1 cnt 1 for hi in range(h):
        if S[h-hi-1][wi] == '#':
            U[h-hi-1][wi] = 0
            cnt = 1
        else:
            U[h-hi-1][wi] = cnt
            cnt += 1 hi range(h) range h if S[h-hi-1][wi] == '#':
            U[h-hi-1][wi] = 0
            cnt = 1
        else:
            U[h-hi-1][wi] = cnt
            cnt += 1 S[h-hi-1][wi] == '#' S[h-hi-1][wi] [h-hi-1] S h-hi-1 h-hi h hi 1 wi '#' U[h-hi-1][wi] = 0 U[h-hi-1][wi] [h-hi-1] U h-hi-1 h-hi h hi 1 wi 0 cnt = 1 cnt 1 U[h-hi-1][wi] = cnt U[h-hi-1][wi] [h-hi-1] U h-hi-1 h-hi h hi 1 wi cnt cnt += 1 cnt 1 ans = 0 ans 0 for hi in range(h):
    for wi in range(w):
        ans = max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3) hi range(h) range h for wi in range(w):
        ans = max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3) wi range(w) range w ans = max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3) ans max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3) max ans L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3 L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi] L[hi][wi]+R[hi][wi]+D[hi][wi] L[hi][wi]+R[hi][wi] L[hi][wi] [hi] L hi wi R[hi][wi] [hi] R hi wi D[hi][wi] [hi] D hi wi U[hi][wi] [hi] U hi wi 3 print(ans) print ans ans = max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3) max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3) ans ans = 0 0 ans w = map(int, input().split()) map(int, input().split()) w D = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] D R = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] R S = [[] for _ in range(h)] [[] for _ in range(h)] S L = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] L cnt = 1 1 cnt cnt = 1 1 cnt cnt = 1 1 cnt cnt = 1 1 cnt cnt += 1 1 cnt cnt = 1 1 cnt cnt += 1 1 cnt ans = 0 0 ans cnt += 1 1 cnt h, w = map(int, input().split()) map(int, input().split()) h U = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] U cnt = 1 1 cnt cnt += 1 1 cnt cnt = 1 1 cnt cnt = 1 1 cnt
h, w = map(int, input().split())
S = [[] for _ in range(h)]
for i in range(h):
    S[i] = list(input())

ans = 0
L = [[0]*w for _ in range(h)]
for hi in range(h):
    cnt = 1
    for wi in range(w):
        if S[hi][wi]=='#':
            L[hi][wi] = 0
            cnt = 1
        else:
            L[hi][wi] = cnt
            cnt += 1

R = [[0]*w for _ in range(h)]
for hi in range(h):
    cnt = 1
    for wi in range(w):
        if S[hi][w-wi-1]=='#':
            R[hi][w-wi-1] = 0
            cnt = 1
        else:
            R[hi][w-wi-1] = cnt
            cnt += 1

D = [[0]*w for _ in range(h)]
for wi in range(w):
    cnt = 1
    for hi in range(h):
        if S[hi][wi]=='#':
            D[hi][wi] = 0
            cnt = 1
        else:
            D[hi][wi] = cnt
            cnt += 1

U = [[0]*w for _ in range(h)]
for wi in range(w):
    cnt = 1
    for hi in range(h):
        if S[h-hi-1][wi] == '#':
            U[h-hi-1][wi] = 0
            cnt = 1
        else:
            U[h-hi-1][wi] = cnt
            cnt += 1

ans = 0
for hi in range(h):
    for wi in range(w):
        ans = max(ans, L[hi][wi]+R[hi][wi]+D[hi][wi]+U[hi][wi]-3)
print(ans)