376_D. Maximum Submatrix 2_36726
You are given a matrix consisting of digits zero and one, its size is n × m. You are allowed to rearrange its rows. What is the maximum area of the submatrix that only consists of ones and can be obtained in the given problem by the described operations?

Let's assume that the rows of matrix a are numbered from 1 to n from top to bottom and the columns are numbered from 1 to m from left to right. A matrix cell on the intersection of the i-th row and the j-th column can be represented as (i, j). Formally, a submatrix of matrix a is a group of four integers d, u, l, r (1 ≤ d ≤ u ≤ n; 1 ≤ l ≤ r ≤ m). We will assume that the submatrix contains cells (i, j) (d ≤ i ≤ u; l ≤ j ≤ r). The area of the submatrix is the number of cells it contains.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 5000). Next n lines contain m characters each — matrix a. Matrix a only contains characters: "0" and "1". Note that the elements of the matrix follow without any spaces in the lines.

Output

Print a single integer — the area of the maximum obtained submatrix. If we cannot obtain a matrix of numbers one, print 0.

Examples

Input

1 1
1


Output

1


Input

2 2
10
11


Output

2


Input

4 3
100
011
000
101


Output

2
#include <bits/stdc++.h>
using namespace std;
void time_start(clock_t *tt) { *tt = clock(); }
void print_time(clock_t tt) {
  tt = clock() - tt;
  printf("executed in %.f ms\n", (float)tt / CLOCKS_PER_SEC * 1000);
}
template <typename T>
inline T getnum() {
  T num = 0;
  char c;
  do {
    c = getchar();
  } while (c != EOF && c == ' ' && c == '\n' && c == '\t');
  int sign = (c == '-' ? -1 : 1);
  if (c != '-') num += (c - '0');
  while ((c = getchar()) != EOF && c != '\n' && c != '\t' && c != ' ') {
    num *= 10;
    num += (c - '0');
  }
  num *= sign;
  return num;
}
inline string getstr() {
  string str;
  char k;
  while ((k = getchar()) == ' ' || k == '\n') {
    k = getchar();
    if (k == ' ' || k == '\n')
      continue;
    else
      break;
  }
  while ((k = getchar()) != EOF && k != '\n' && k != '\t' && k != '\v' &&
         k != '\0' && k != ' ')
    str.push_back(k);
  return str;
}
int mat[5005][5005], res[5005][5005];
int main() {
  int n, m;
  scanf("%d%d\n", &n, &m);
  memset(mat, 0, sizeof(mat));
  memset(res, 0, sizeof(res));
  char t;
  for (int i = (int)0, _b = (int)n - 1; i <= _b; i++) {
    if (i) getchar();
    for (int j = (int)0, _b = (int)m - 1; j <= _b; j++) {
      t = getchar();
      mat[i][j] = t - '0';
      if (j) mat[i][j] = (mat[i][j] ? mat[i][j - 1] + 1 : 0);
      res[j][mat[i][j]]++;
    }
  }
  long long ans = 0, cnt;
  for (int i = (int)0, _b = (int)m - 1; i <= _b; i++) {
    cnt = 0;
    for (int j = (int)m, _b = (int)0; j >= _b; j--) {
      cnt += res[i][j];
      ans = max(ans, cnt * j);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}

4 3
100
011
000
101
 2 2
10
11
 1 1
1
 1 1
0
 13 19
0000111111111111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0110101010001111100
0001011010100111001
1111101000110001000
0010010000011100010
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011101101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011010000
 19 12
110001100110
100100000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111100000
100000011010
000100100101
 15 18
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
111111111111111111
 8 5
00000
00000
00000
00000
00000
00000
00000
00000
 13 19
0000111111111111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0010101010001111100
0001011010100111001
1111101000110001000
0010010000011100010
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011010000
 19 12
110001100110
100100000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110000
100000011010
000100100101
 4 3
100
011
000
100
 4 3
100
001
000
000
 19 12
110001100110
100101000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010011110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100010011010
000100100101
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011101101110000
1001100011010111
0010011111111000
0100100000111110
1001000000100111
0110000011001000
1011111011010000
 19 12
110001100110
100100000000
101011001111
010111010001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100000011010
000100100101
 4 3
100
011
100
100
 13 19
0000111111111111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100000010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0010101010001111100
0001011010100111001
1111101000110001000
0010010000011100010
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011000000
 19 12
110001100110
100100000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100000011010
000100100101
 4 3
100
011
000
000
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 19 12
110001100110
100101000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100000011010
000100100101
 11 16
0111110101100011
1000101110010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 19 12
110001100110
100101000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100010011010
000100100101
 4 3
000
001
000
000
 11 16
0111110101100011
0000101110010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110101100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110111100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110111100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010111111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 13 19
0000111111011111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0110101010001111100
0001011010100111001
1111101000110001000
0010010000011100010
 8 5
00000
00010
00000
00000
00000
00000
00000
00000
 13 19
0000111111111111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0010101010001111101
0001011010100111001
1111101000110001000
0010010000011100010
 11 16
0111110101100011
1000101100010000
0010110110010001
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011010000
 13 19
0000111111111111011
0111000001110001101
0110100110111011101
0001101011100001110
1101100000010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0010101010001111100
0001011010100111001
1111101000110001000
0010010000011100010
 11 16
0111110101100011
1000101100011000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011000000
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111010
1001000000100111
0110000011001100
1011111011000000
 19 12
110001100110
100101000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
011111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100000011010
000100100101
 4 3
100
001
010
000
 11 16
0111110101100011
1000101110010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100110100111110
1001000000100111
0110000011001100
1011111011000000
 19 12
110001100110
100101000000
101011001111
010111110001
011000100101
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100010011010
000100100101
 11 16
0111110101100011
0000101110010000
0010110110010101
1110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110100100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110111100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001001000100111
0110000011001100
1011111011000000
 11 16
0111110111100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010111111111000
0100100100111110
1001000000100110
0110000011001100
1011111011000000
 13 19
0000111111011111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0110101010001111100
0001011010100111001
1111101000110001010
0010010000011100010
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011101101110000
1001100011010111
0010011111111000
0100100000111110
1001000000100111
0110000011000000
1011111011010000
 8 5
00000
00010
10000
00000
00000
00000
00000
00000
 13 19
0000111111111111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0010101010001111101
0001011010100111001
1111101001110001000
0010010000011100010
 11 16
0111110101100011
1000101100010000
0010110110010001
0110110010110010
0011111101110010
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011010000
 13 19
0000111111111111011
0111000001110001101
0100100110111011101
0001101011100001110
1101100000010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0010101010001111100
0001011010100111001
1111101000110001000
0010010000011100010
 11 16
0111110101100011
1000101100011000
0010110110010101
0110110010110010
0011111101110000
1001000011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001000
1011111011000000
 4 3
100
011
100
110
 11 16
0111110101100011
1000101100010000
0010110110010101
0110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111011
1001000000100111
0110000011001100
1011111011000000
 19 12
110001100110
100101000000
101011001111
010111110001
011000100100
011111010000
010011101100
011010011110
011001111110
010111110101
010000010111
011111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100000011010
000100100101
 4 3
100
001
010
100
 11 16
0111110101100011
1000101110010000
0010110110010101
0110110010110010
0011111101110000
0001100011010111
0010011111111000
0100110100111110
1001000000100111
0110000011001100
1011111011000000
 19 12
110001100110
100101000000
101011101111
010111110001
011000100101
011111010000
010011101100
011010011110
011001111110
010111110001
010000010111
001111110100
100100110001
100110000000
110000010010
111101011101
010111110010
100010011010
000100100101
 11 16
0111110101000011
0000101110010000
0010110110010101
1110110010110010
0011111101110000
1001100011010111
0010011111111000
0100100100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110100100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010011111111000
0100000100111110
1001000000100111
0110000011001100
1011111011000000
 11 16
0111110111100011
0000101110010000
0010110110010101
0110110010110110
0011111101110000
1001100011010111
0010111111111000
0100100100111110
1001000000100110
0110000011001110
1011111011000000
 13 19
0000111111011111011
0111000001110001101
1110100110111011101
0001101011100001110
1101100100010000101
1010100011110011010
1010011101010000001
1011101000001111000
1101110001101011110
0110101010001111100
0001011010110111001
1111101000110001010
0010010000011100010
 11 16
0111110101100011
1000101100010100
0010110110010101
0110110010110010
0011101101110000
1001100011010111
0010011111111000
0100100000111110
1001000000100111
0110000011000000
1011111011010000

2 2 1 0 14 9 16 270 0 14 12 20 2 1 16 9 15 3 14 12 20 2 12 20 12 20 1 12 12 12 12 14 1 14 12 14 12 12 20 1 12 20 12 12 12 12 14 9 1 14 12 14 12 3 12 20 2 12 20 12 12 12 14 9