/*
 Aizu Vol-1 0116: Rectangular Searching
 2017.8.14 bal4u@uu
 ????????°n???????????£?¶????????????????1??????????????????k?
 */

#include <stdio.h>
#include <ctype.h>
char *gets();

#define SIZE 500
char buf[SIZE + 5], *p, *pe;
int getInt(void)
{
    int n = 0;
    while (isspace(*p)) p++;
    while (isdigit(*p)) n = 10 * n + (*p++ - '0');
    return n;
}

#define WW 16   //  must > 1000/32
unsigned map[SIZE + 10][WW], *q; int len;

int lt[256] = {
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8 };
int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 2, 2, 3, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 4, 1,
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 0,
    0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 3, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 4, 0,
    1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 0,
    0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 3, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 4, 0,
    0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 3, 0, 0, 0, 1, 0, 1, 1, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0 };

int maxBits(unsigned *a, int len)
{
    int i, k, n, p, l, m, r;
    unsigned *e = a + len;
    k = p = 0;
    while (a < e) {
        if (!*a) { if (p > k) k = p; p = 0; }
        else if (*a == 0xffffffffU) p += 32;
        else {
            for (i = 24; i >= 0; i -= 8) {
                n = ((*a) >> i) & 0xff;
                l = lt[n], m = mt[n], r = rt[n];
                if (l == 8) p += 8;
                else {
                    if (m > k) k = m;
                    p += l; if (p > k) k = p; p = r;
                }
            }
        }
        a++;
    }
    if (p > k) k = p;
    return k;
}

int main()
{
    int H, W, i, j, k, max;
    unsigned m, *d;
    
    while (1) {
        gets(p = buf); H = getInt(), W = getInt(); if (!H) break;
        pe = buf + W, max = 0;
        for (i = 0; i < H; i++) {
            gets(p = buf), q = map[i], k = 0, m = 0;
            while (p < pe) {
                m <<= 1;
                if (*p++ == '.') m |= 1;
                if (++k == 32) { if (m) max = 1; *q++ = m, k = 0, m = 0; }
            }
            if (k) {m <<= (32-k); *q++ = m; if (m) max = 1; }
            len = q - map[i];
        }
        if (!max) { puts("0"); continue; }
        for (i = 0; i < H; i++) {
            for (j = i + 1; j < H; j++) {
                for (d = map[i], q = map[j], k = len; k--; ) *d++ &= *q++;
                k = maxBits(map[i], len) * (j - i + 1);
                if (k > max) max = k;
            }
        }
        printf("%d\n", max);
    }
    return 0;
}

Measured memory_bytes: 560