import numpy as np


def main():
    H, W = list(map(int, input().split(' ')))
    field = np.array([list(input()) for _ in range(H)])
    field = np.where(field == '#', 0, 1)
    left, right, up, down = [np.zeros((H, W)) for _ in range(4)]
    for w in range(W):
        left[:, w] = (left[:, w-1] + 1) * field[:, w]
        right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1]
    for h in range(H):
        up[h, :] = (up[h-1, :] + 1) * field[h, :]
        down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :]
    s = left + right + up + down - 3
    print(int(np.max(s)))


if __name__ == '__main__':
    main() import numpy as np numpy def main():
    H, W = list(map(int, input().split(' ')))
    field = np.array([list(input()) for _ in range(H)])
    field = np.where(field == '#', 0, 1)
    left, right, up, down = [np.zeros((H, W)) for _ in range(4)]
    for w in range(W):
        left[:, w] = (left[:, w-1] + 1) * field[:, w]
        right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1]
    for h in range(H):
        up[h, :] = (up[h-1, :] + 1) * field[h, :]
        down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :]
    s = left + right + up + down - 3
    print(int(np.max(s))) main H, W = list(map(int, input().split(' '))) H list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' W list(input()) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(input()) list input() input field = np.array([list(input()) for _ in range(H)]) field np.array([list(input()) for _ in range(H)]) np.array np array [list(input()) for _ in range(H)] field = np.where(field == '#', 0, 1) field np.where(field == '#', 0, 1) np.where np where field == '#' field '#' 0 1 np.zeros((H, W)) for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) np.zeros((H, W)) np.zeros np zeros (H, W) H W left, right, up, down = [np.zeros((H, W)) for _ in range(4)] left [np.zeros((H, W)) for _ in range(4)] right up down for w in range(W):
        left[:, w] = (left[:, w-1] + 1) * field[:, w]
        right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1]
     w range(W) range W left[:, w] = (left[:, w-1] + 1) * field[:, w] left[:, w] left : (left[:, w-1] + 1) * field[:, w] left[:, w-1] + 1 left[:, w-1] left : 1 field[:, w] field : right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1] right[:, -w-1] right : (right[:, -w] + 1) * field[:, -w-1] right[:, -w] + 1 right[:, -w] right : 1 field[:, -w-1] field : for h in range(H):
        up[h, :] = (up[h-1, :] + 1) * field[h, :]
        down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :]
     h range(H) range H up[h, :] = (up[h-1, :] + 1) * field[h, :] up[h, :] up h (up[h-1, :] + 1) * field[h, :] up[h-1, :] + 1 up[h-1, :] up h-1 h 1 1 field[h, :] field h down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :] down[-h-1, :] down -h-1 -h h 1 (down[-h, :] + 1) * field[-h-1, :] down[-h, :] + 1 down[-h, :] down -h h 1 field[-h-1, :] field -h-1 -h h 1 s = left + right + up + down - 3 s left + right + up + down - 3 left + right + up + down left + right + up left + right left right up down 3 print(int(np.max(s))) print int(np.max(s)) int np.max(s) np.max np max s if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    H, W = list(map(int, input().split(' ')))
    field = np.array([list(input()) for _ in range(H)])
    field = np.where(field == '#', 0, 1)
    left, right, up, down = [np.zeros((H, W)) for _ in range(4)]
    for w in range(W):
        left[:, w] = (left[:, w-1] + 1) * field[:, w]
        right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1]
    for h in range(H):
        up[h, :] = (up[h-1, :] + 1) * field[h, :]
        down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :]
    s = left + right + up + down - 3
    print(int(np.max(s))) def main():
    H, W = list(map(int, input().split(' ')))
    field = np.array([list(input()) for _ in range(H)])
    field = np.where(field == '#', 0, 1)
    left, right, up, down = [np.zeros((H, W)) for _ in range(4)]
    for w in range(W):
        left[:, w] = (left[:, w-1] + 1) * field[:, w]
        right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1]
    for h in range(H):
        up[h, :] = (up[h-1, :] + 1) * field[h, :]
        down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :]
    s = left + right + up + down - 3
    print(int(np.max(s))) main
import numpy as np


def main():
    H, W = list(map(int, input().split(' ')))
    field = np.array([list(input()) for _ in range(H)])
    field = np.where(field == '#', 0, 1)
    left, right, up, down = [np.zeros((H, W)) for _ in range(4)]
    for w in range(W):
        left[:, w] = (left[:, w-1] + 1) * field[:, w]
        right[:, -w-1] = (right[:, -w] + 1) * field[:, -w-1]
    for h in range(H):
        up[h, :] = (up[h-1, :] + 1) * field[h, :]
        down[-h-1, :] = (down[-h, :] + 1) * field[-h-1, :]
    s = left + right + up + down - 3
    print(int(np.max(s)))


if __name__ == '__main__':
    main()