import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Comparator;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Writer;
import java.util.HashSet;
import java.util.List;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out){
	    int n = in.ri(), m = in.ri(), res = 0;
	    char[][] tab = IOUtils.readTable(in, n, m);
	    int[][] mem = new int[n][m];
	    for(int row = 0; row < n; row++) {
		    for(int col = m - 1; col >= 0; col--){
			    if (tab[row][col] == '1') mem[row][col] = (col == m - 1) ? 1 : mem[row][col + 1] + 1;
		    }
	    }
	    for(int col = 0; col < m; col++) {
		    int[] curcolvals = new int[n];
		    for(int i = 0; i < n; i++) curcolvals[i] = mem[i][col];
		    ArrayUtils.countingSort(curcolvals, -1, 5005);
		    ArrayUtils.reverse(curcolvals);
		    for(int i = 0; i < curcolvals.length; i++) {
			    int howmany = i + 1;
			    int width = curcolvals[i];
			    res = Math.max(res, howmany * width);
		    }
	    }
	    out.printLine(res);

    }
}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	public int ri(){
		return readInt();
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}
	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}
	public void close() {
		writer.close();
	}
	public void printLine(int i) {
		writer.println(i);
	}

}

class IOUtils {
	public static char[] readCharArray(InputReader in, int size) {
		char[] array = new char[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readCharacter();
		return array;
	}
	public static char[][] readTable(InputReader in, int rowCount, int columnCount) {
		char[][] table = new char[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readCharArray(in, columnCount);
		return table;
	}
}

class ArrayUtils {
	public static void reverse(int[] array) {
		for (int i = 0, j = array.length - 1; i < j; i++, j--) {
			int temp = array[i];
			array[i] = array[j];
			array[j] = temp;
		}
	}
	public static void countingSort(int[] a, int low, int high)
	{
		int[] counts = new int[high - low + 1];
		for (int x : a)
			counts[x - low]++;

		int current = 0;
		for (int i = 0; i < counts.length; i++)
		{
			Arrays.fill(a, current, current + counts[i], i + low);
			current += counts[i];
		}
	}
}


import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out){
	    int n = in.ri(), m = in.ri(), res = 0;
	    char[][] tab = IOUtils.readTable(in, n, m);
	    int[][] mem = new int[n][m];
	    for(int row = 0; row < n; row++) for(int col = m - 1; col >= 0; col--) if (tab[row][col] == '1') mem[row][col] = (col == m - 1) ? 1 : mem[row][col + 1] + 1;
	    for(int col = 0; col < m; col++) {
		    int[] valamount = new int[5003], memoized = new int[5003];
		    for(int i = 0; i < mem.length; i++) valamount[mem[i][col]]++;
		    for(int i = memoized.length - 2; i >= 0; i--) memoized[i] = valamount[i] + memoized[i + 1];
		    for(int i = 0; i < memoized.length; i++) res = Math.max(res, memoized[i] * i);
	    }
	    out.printLine(res);
    }
}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	public int ri(){
		return readInt();
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}
	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}
	public void close() {
		writer.close();
	}
	public void printLine(int i) {
		writer.println(i);
	}

}

class IOUtils {
	public static char[] readCharArray(InputReader in, int size) {
		char[] array = new char[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readCharacter();
		return array;
	}
	public static char[][] readTable(InputReader in, int rowCount, int columnCount) {
		char[][] table = new char[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readCharArray(in, columnCount);
		return table;
	}
}


import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Alex
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out){
	    int n = in.ri(), m = in.ri();
	    char[][] tab = IOUtils.readTable(in, n, m);
	    int[][] mem = new int[n][m];
	    for(int row = 0; row < n; row++) {
		    for(int col = m - 1; col >= 0; col--){
			    if (tab[row][col] == '1') mem[row][col] = (col == m - 1) ? 1 : mem[row][col + 1] + 1;
		    }
	    }
	    int res = 0;
	    for(int col = 0; col < m; col++) {
		    int[] curcolvals = new int[n];
		    for(int i = 0; i < n; i++) curcolvals[i] = mem[i][col];
		    int[] valamount = new int[5003];
		    for(int i = 0; i < curcolvals.length; i++) valamount[curcolvals[i]]++;
		    int[] memoized = new int[5003];
		    for(int i = memoized.length - 2; i >= 0; i--) memoized[i] = valamount[i] + memoized[i + 1];
for(int i = 0; i < memoized.length; i++) {
			    int howmany = memoized[i];
			    int width = i;
			    res = Math.max(res, howmany * width);
		    }
	    }
	    out.printLine(res);
    }
}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	public int ri(){
		return readInt();
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}
	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}
	public void close() {
		writer.close();
	}
	public void printLine(int i) {
		writer.println(i);
	}

}

class IOUtils {
	public static char[] readCharArray(InputReader in, int size) {
		char[] array = new char[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readCharacter();
		return array;
	}
	public static char[][] readTable(InputReader in, int rowCount, int columnCount) {
		char[][] table = new char[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readCharArray(in, columnCount);
		return table;
	}
}


import java.io.*;
import java.util.StringTokenizer;

import static java.lang.Math.max;

public class solver {

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        StringTokenizer str;
        str = new StringTokenizer(in.readLine(), " ");
        int n = Integer.parseInt(str.nextToken());
        int m = Integer.parseInt(str.nextToken());
        char[][] data = new char[n][m];
        for (int i = 0; i < n; i++) {
            data[i] = in.readLine().toCharArray();
        }

        int[] d = new int[m];
        int ans = 0;
        for (int i = 0; i < m; ++i) {
            for (int j = 0; j < n; ++j) {
                if ((i == 0 || data[j][i - 1] == '0') && (data[j][i] == '1')) {
                    int k = i;
                    while (k < m && data[j][k] == '1') {
                        ++d[k++];
                    }
                }
            }
            for (int j = i; j < m; ++j) {
                ans = max(ans, (j - i + 1) * d[j]);
            }
        }

        out.println(ans);
        out.flush();
    }

}


import java.io.*;
import java.util.StringTokenizer;

import static java.lang.Math.max;

public class solver {

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        StringTokenizer str;
        str = new StringTokenizer(in.readLine(), " ");
        int n = Integer.parseInt(str.nextToken());
        int m = Integer.parseInt(str.nextToken());
        char[][] data = new char[n][m];
        for (int i = 0; i < n; i++) {
            data[i] = in.readLine().toCharArray();
        }

        int[] d = new int[m];
        int ans = 0;
        for (int j = 0; j < m; ++j) {
            for (int i = 0; i < n; ++i) {
                if ((j == 0 || data[i][j - 1] == '0') && (data[i][j] == '1')) {
                    int k = j;
                    while (k < m && data[i][k] == '1') {
                        ++d[k++];
                    }
                }
            }
            for (int k = j; k < m; ++k) {
                ans = max(ans, (k - j + 1) * d[k]);
            }
        }

        out.println(ans);
        out.flush();
    }

}


import java.io.*;
import java.util.StringTokenizer;

import static java.lang.Math.max;

public class solver {

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        StringTokenizer str;
        str = new StringTokenizer(in.readLine(), " ");
        int n = Integer.parseInt(str.nextToken());
        int m = Integer.parseInt(str.nextToken());
        char[][] data = new char[n][m];
        for (int i = 0; i < n; i++) {
            str = new StringTokenizer(in.readLine());
            String help = str.nextToken();
            for (int j = 0; j < m; j++) {
                data[i][j] = help.charAt(j);
            }
        }

        int[] d = new int[m];
        int ans = 0;
        for (int i = 0; i < m; ++i) {
            for (int j = 0; j < n; ++j) {
                if ((i == 0 || data[j][i - 1] == '0') && (data[j][i] == '1')) {
                    int k = i;
                    while (k < m && data[j][k] == '1') {
                        ++d[k++];
                    }
                }
            }
            for (int j = i; j < m; ++j) {
                ans = max(ans, (j - i + 1) * d[j]);
            }
        }

        out.println(ans);
        out.flush();
    }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class P375B
{
	public static void main(String[] args)
	{
		FastScanner scan = new FastScanner();
		int n = scan.nextInt(), m = scan.nextInt();
		char[][] grid = new char[n][m];
		for (int i = 0; i < n; i++)
			grid[i] = scan.next().toCharArray();
		int[][] ones = new int[n][m];
		for (int i = 0; i < n; i++)
		{
			for (int j = m-1; j >= 0; j--)
			{
				if (grid[i][j] == '1')
				{
					ones[i][j]++;
					if (j < m-1)
						ones[i][j] += ones[i][j+1];
				}
			}
		}
		int max = 0;
		for (int i = 0; i < m; i++)
		{
			int[] arr = new int[n];
			for (int j = 0; j < n; j++)
				arr[j] = ones[j][i];
			Arrays.sort(arr);
			int left = n;
			for (int j = 0; j < arr.length; j++)
			{
				max = Math.max(max, arr[j]*left);
				left--;
			}
		}
		System.out.println(max);
	}

	static class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner()
		{
			try
			{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e)
			{
				e.printStackTrace();
			}
		}

		public String next()
		{
			if (st.hasMoreTokens())
				return st.nextToken();
			try
			{
				st = new StringTokenizer(br.readLine());
			} catch (Exception e)
			{
				e.printStackTrace();
			}
			return st.nextToken();
		}

		public int nextInt()
		{
			return Integer.parseInt(next());
		}

		public long nextLong()
		{
			return Long.parseLong(next());
		}

		public String nextLine()
		{
			String line = "";
			try
			{
				line = br.readLine();
			} catch (Exception e)
			{
				e.printStackTrace();
			}
			return line;
		}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];
       int[] arr = new int[n];

       for(int j = m - 1; j >= 0; j--){

          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
             }

             arr[i] = cum[i];
          }

          Arrays.sort(arr);
          int size = Integer.MAX_VALUE;
          int cnt = 0;

          for(int i = n - 1 ; i >= 0; i--){
             int num = arr[i];
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);
          }

       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];

       for(int j = m - 1; j >= 0; j--){

          PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());

          int[] nextCum = new int[n];
          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';

             if(num == 0){
                nextCum[i] = 0;
             }else{
                nextCum[i] = cum[i] + num;
             }

             pq.add(nextCum[i]);

          }

          int size = Integer.MAX_VALUE;
          int cnt = 0;
          while(pq.size() != 0){

             int num = pq.poll();
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);

          }

          cum = nextCum;
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];
       PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(int j = m - 1; j >= 0; j--){

          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
                pq.add(cum[i]);
             }

          }

          int size = Integer.MAX_VALUE;
          int cnt = 0;
          while(pq.size() != 0){

             int num = pq.poll();
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);

          }
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];

       for(int j = m - 1; j >= 0; j--){

          PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());

          int[] nextCum = new int[n];
          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
             }

             pq.add(cum[i]);
          }

          int size = Integer.MAX_VALUE;
          int cnt = 0;
          while(pq.size() != 0){

             int num = pq.poll();
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);

          }
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];

       for(int j = m - 1; j >= 0; j--){

          PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());

          int[] nextCum = new int[n];
          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
                pq.add(cum[i]);
             }

          }

          int size = Integer.MAX_VALUE;
          int cnt = 0;
          while(pq.size() != 0){

             int num = pq.poll();
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);

          }
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];
       List<Integer> arr = new ArrayList<>();

       for(int j = m - 1; j >= 0; j--){

          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
                arr.add(cum[i]);
             }

          }

          Collections.sort(arr, Collections.reverseOrder());
          int size = Integer.MAX_VALUE;
          int cnt = 0;

          for(int i = 0 ; i < arr.size(); i++){
             int num = arr.get(i);
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);
          }

          arr.clear();
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[][] cum = new int[n][m + 1];

       for(int i = 0; i < n; i++){
          for(int j = m - 1; j >= 0; j--){

               int num = mat.get(i).charAt(j) - '0';

               if(num == 0){
                  cum[i][j] = 0;
               }else{
                  cum[i][j] = cum[i][j + 1] + num;
               }

          }
       }

       for(int j = 0; j < m; j++){

          PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
          for(int i = 0; i < n; i++){
             pq.add(cum[i][j]);
          }

          int side = Integer.MAX_VALUE;
          int cnt = 0;
          while(pq.size() != 0){
             int num = pq.poll();
             side = Math.min(side, num);
             cnt++;
             ans = Math.max(ans, side * cnt);
          }

       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];
       List<Integer> arr = new ArrayList<>();

       for(int j = m - 1; j >= 0; j--){

          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
                arr.add(cum[i]);
             }

          }

          Collections.sort(arr);
          int size = Integer.MAX_VALUE;
          int cnt = 0;

          for(int i = 0 ; i < arr.size(); i++){
             int num = arr.get(i);
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);
          }

          arr.clear();
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {

    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length;
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = this.tree[2 * i] & this.tree[2 * i + 1];
          }

       }

       public int query(int l, int r){

          int res = (1 << 31) - 1;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res &= tree[l];
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res &= tree[r];
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }
    }

    public void solve() throws IOException{

       int n = in.nextInt();
       int m = in.nextInt();
       int ans = 0;

       List<String> mat = new ArrayList<>();
       for(int i = 0; i < n; i++){
           String str = in.next();
           mat.add(str);
       }

       int[] cum = new int[n];
       PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder())
       for(int j = m - 1; j >= 0; j--){

          for(int i = 0; i < n; i++){

             int num = mat.get(i).charAt(j) - '0';
             if(num == 0){
                cum[i] = 0;
             }else{
                cum[i]++;
                pq.add(cum[i]);
             }

          }

          int size = Integer.MAX_VALUE;
          int cnt = 0;
          while(pq.size() != 0){

             int num = pq.poll();
             size = Math.min(size, num);
             cnt++;
             ans = Math.max(ans, size * cnt);

          }
       }

       out.println(ans);
       return;
    }

    FastScanner in;
    PrintWriter out;

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException{
        new Main().run();
    }

    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }

    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x;
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}


import java.io.OutputStream;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedInputStream;
import java.util.*;

/**
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CReducingFractions solver = new CReducingFractions();
        solver.solve(1, in, out);
        out.close();
    }

    static class CReducingFractions {

        private static final int mod = (int) (1e9 + 7);

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int m = in.scanInt();

            int dp[][] = new int[n][m];
            for(int i=0;i<n;i++){
                String str = in.scanString();
                for(int j=0;j<m;j++){
                    dp[i][j] = str.charAt(j)-'0';
                }
            }

            for(int i=0;i<n;i++){
                for(int j =m-2;j>=0;j--){
                    if(dp[i][j]==1)dp[i][j]+=dp[i][j+1];
                }
            }

            long ans = 0;
            for(int start = 0;start < m ;start++){
                int []temp = new int[n];
                int count[] = new int[m+5];
                int p= 0;
                for(int i=0;i<n;i++)count[dp[i][start]]++;
                for(int i=0;i<m+5;i++){
                    while(count[i] > 0){
                        temp[p++] = i;
                        count[i]--;
                    }
                }
                for(int i=0;i<n;i++)ans = Math.max(ans,temp[i] * (n-i));
            }

            out.println(ans);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public String scanLine() {
            int c = scan();
            if (c == -1) return null;
            while (isWhiteSpace(c)) c = scan();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = scan();
            } while (c != '\n' && c != -1);
            return res.toString();
        }

        public char scanChar() {
            int c = scan();
            while (isWhiteSpace(c)) c = scan();
            return (char) c;
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        public String scanString() {
            int c = scan();
            while (isWhiteSpace(c)) c = scan();
            StringBuilder RESULT = new StringBuilder();
            do {
                RESULT.appendCodePoint(c);
                c = scan();
            } while (!isWhiteSpace(c));
            return RESULT.toString();
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

        public long scanLong() {
            long I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        public void scanLong(long[] A) {
            for (int i = 0; i < A.length; i++) A[i] = scanLong();
        }

        public void scanInt(int[] A) {
            for (int i = 0; i < A.length; i++) A[i] = scanInt();
        }

        public double scanDouble() {
            int c = scan();
            while (isWhiteSpace(c)) c = scan();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = scan();
            }
            double RESULT = 0;
            while (!isWhiteSpace(c) && c != '.') {
                if (c == 'e' || c == 'E') {
                    return RESULT * Math.pow(10, scanInt());
                }
                RESULT *= 10;
                RESULT += c - '0';
                c = scan();
            }
            if (c == '.') {
                c = scan();
                double m = 1;
                while (!isWhiteSpace(c)) {
                    if (c == 'e' || c == 'E') {
                        return RESULT * Math.pow(10, scanInt());
                    }
                    m /= 10;
                    RESULT += (c - '0') * m;
                    c = scan();
                }
            }
            return RESULT * sgn;
        }

    }
}


import java.io.OutputStream;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedInputStream;
import java.util.*;

/**
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CReducingFractions solver = new CReducingFractions();
        solver.solve(1, in, out);
        out.close();
    }

    static class CReducingFractions {

        private static final int mod = (int) (1e9 + 7);

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int m = in.scanInt();

            int dp[][] = new int[n][m];
            for(int i=0;i<n;i++){
                String str = in.scanString();
                for(int j=0;j<m;j++){
                    dp[i][j] = str.charAt(j)-'0';
                }
            }

            for(int i=0;i<n;i++){
                for(int j =m-2;j>=0;j--){
                    if(dp[i][j]==1)dp[i][j]+=dp[i][j+1];
                }
            }

            long ans = 0;
            for(int start = 0;start < m ;start++){
                int []temp = new int[n];
                for(int i=0;i<n;i++)temp[i] = dp[i][start];
                Arrays.sort(temp);
                for(int len =1;len <= m;len++){
                    int l = 0;
                    int r = temp.length -1 ;
                    int index = -1;
                    while(l <= r){
                        int mid = (l + r)/2;
                        if(temp[mid] >= len){
                            index = mid;
                            r = mid -1;
                        }else{
                            l = mid +1;
                        }
                    }
                    if(index != -1)ans = Math.max(ans,len * (temp.length - 1 - index +1));

                }
            }

            out.println(ans);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public String scanLine() {
            int c = scan();
            if (c == -1) return null;
            while (isWhiteSpace(c)) c = scan();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = scan();
            } while (c != '\n' && c != -1);
            return res.toString();
        }

        public char scanChar() {
            int c = scan();
            while (isWhiteSpace(c)) c = scan();
            return (char) c;
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        public String scanString() {
            int c = scan();
            while (isWhiteSpace(c)) c = scan();
            StringBuilder RESULT = new StringBuilder();
            do {
                RESULT.appendCodePoint(c);
                c = scan();
            } while (!isWhiteSpace(c));
            return RESULT.toString();
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

        public long scanLong() {
            long I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        public void scanLong(long[] A) {
            for (int i = 0; i < A.length; i++) A[i] = scanLong();
        }

        public void scanInt(int[] A) {
            for (int i = 0; i < A.length; i++) A[i] = scanInt();
        }

        public double scanDouble() {
            int c = scan();
            while (isWhiteSpace(c)) c = scan();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = scan();
            }
            double RESULT = 0;
            while (!isWhiteSpace(c) && c != '.') {
                if (c == 'e' || c == 'E') {
                    return RESULT * Math.pow(10, scanInt());
                }
                RESULT *= 10;
                RESULT += c - '0';
                c = scan();
            }
            if (c == '.') {
                c = scan();
                double m = 1;
                while (!isWhiteSpace(c)) {
                    if (c == 'e' || c == 'E') {
                        return RESULT * Math.pow(10, scanInt());
                    }
                    m /= 10;
                    RESULT += (c - '0') * m;
                    c = scan();
                }
            }
            return RESULT * sgn;
        }

    }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
//    ScanReader scanner = new ScanReader(System.in);
        Scanner scanner = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(scanner, out);
        out.close();
    }

    final static int MAXN = 5 * 1000000 + 5;
    final static int MAXK = 505;
    static int N = 0;
    static int M = 0;
    static int K = 0;
    static int W = 0;
    static int H = 0;
    static int[][] A;
    static long[][] dp;
    static int[][] pre;
    static int[][] g;
    static int curAns = Integer.MAX_VALUE;
    static long[] HASH;
    static long MOD = (1L << 50) + 7;
    static int[] WC;

    static void solve(Scanner scanner, PrintWriter out) {
        N = scanner.nextInt();
        M = scanner.nextInt();
        A = new int[N][M];
        scanner.nextLine();
        for (int i = 0; i < N; i++) {
            String line = scanner.nextLine();
            for (int j = 0; j < M; j++) {
                A[i][j] = line.charAt(j) == '1' ? 1 : 0;
            }
        }

        int[][] ones = new int[N][M];
        for (int ri = 0; ri < N; ri++) {
            int l = M - 1;
            int r = M - 1;
            while (l >= 0) {
                if (A[ri][l] == 0) {
                    int count = r - l;
                    for (int i = l + 1; i < r + 1; i++) {
                        ones[ri][i] = count - (i - l - 1);
                    }
                    r = l - 1;
                }
                l--;
            }
            int count = r + 1;
            for (int i = 0; i < r + 1; i++) {
                ones[ri][i] = count - i;
            }
        }

        int ans = 0;
        int[] width = new int[M+1];
        for (int left = 0; left < M; left++) {
            Arrays.fill(width, 0);
            for (int ri = 0; ri < N; ri++) {
                width[ones[ri][left]] += 1;
            }
            int lower = 0;
            for (int w = 0; w <= M; w++) {
                int h = M - lower;
                ans = Math.max(ans, w * h);
                lower += width[w];
                if (lower >= M) {
                    break;
                }
            }
        }
        out.println(ans);
    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int nextInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}

class UnioinSet {
    private Map<Long, Long> parents = new HashMap<>();

    public Long find(Long u) {
        if (parents.getOrDefault(u, u).equals(u)) {
            return u;
        }

        return find(parents.get(u));
    }

    public void union(Long u, Long v) {
        Long pu = find(u);
        Long pv = find(v);

        parents.put(pu, pv);
    }
}

class Pair implements Comparable<Pair> {
    public int x;
    public int y;

    public Pair(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int toIndex(int base) {
        return this.x * base + this.y;
    }

    public List<Pair> neighbors() {
        List<Pair> ans = new ArrayList<>();
        ans.add(new Pair(this.x + 1, this.y));
        ans.add(new Pair(this.x - 1, this.y));
        ans.add(new Pair(this.x, this.y + 1));
        ans.add(new Pair(this.x, this.y - 1));

        return ans;
    }

    @Override
    public int compareTo(Pair o) {
        if (o.x != this.x) {
            return this.x - o.x;
        } else {
            return this.y - o.y;
        }
    }

    @Override
    public int hashCode() {
        int v = this.x * 100000 + this.y;
        return Integer.hashCode(v);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Pair) {
            Pair op = (Pair) obj;
            return op.x == this.x && op.y == this.y;
        }

        return false;
    }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
//    ScanReader scanner = new ScanReader(System.in);
        Scanner scanner = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(scanner, out);
        out.close();
    }

    final static int MAXN = 5 * 1000000 + 5;
    final static int MAXK = 505;
    static int N = 0;
    static int M = 0;
    static int K = 0;
    static int W = 0;
    static int H = 0;
    static int[][] A;
    static long[][] dp;
    static int[][] pre;
    static int[][] g;
    static int curAns = Integer.MAX_VALUE;
    static long[] HASH;
    static long MOD = (1L << 50) + 7;
    static int[] WC;

    static void solve(Scanner scanner, PrintWriter out) {
        N = scanner.nextInt();
        M = scanner.nextInt();
        A = new int[N][M];
        scanner.nextLine();
        for (int i = 0; i < N; i++) {
            String line = scanner.nextLine();
            for (int j = 0; j < M; j++) {
                A[i][j] = line.charAt(j) == '1' ? 1 : 0;
            }
        }

        int[][] ones = new int[N][M];
        for (int ri = 0; ri < N; ri++) {
            int l = M - 1;
            int r = M - 1;
            while (l >= 0) {
                if (A[ri][l] == 0) {
                    int count = r - l;
                    for (int i = l + 1; i < r + 1; i++) {
                        ones[ri][i] = count - (i - l - 1);
                    }
                    r = l - 1;
                }
                l--;
            }
            int count = r + 1;
            for (int i = 0; i < r + 1; i++) {
                ones[ri][i] = count - i;
            }
        }

        int ans = 0;
        TreeMap<Integer, Integer> ws = new TreeMap<>();
        for (int left = 0; left < M; left++) {
            ws.clear();
            for (int ri = 0; ri < N; ri++) {
                int w = ones[ri][left];
                ws.put(w, ws.getOrDefault(w, 0) + 1);
            }
            int lower = 0;
            for (Map.Entry<Integer, Integer> entry: ws.entrySet()) {
                int w = entry.getKey();
                int c = entry.getValue();
                int h = N - lower;
                ans = Math.max(ans, w * h);
                lower += c;
                if (lower >= N) {
                    break;
                }
            }
        }
        out.println(ans);
    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int nextInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}

class UnioinSet {
    private Map<Long, Long> parents = new HashMap<>();

    public Long find(Long u) {
        if (parents.getOrDefault(u, u).equals(u)) {
            return u;
        }

        return find(parents.get(u));
    }

    public void union(Long u, Long v) {
        Long pu = find(u);
        Long pv = find(v);

        parents.put(pu, pv);
    }
}

class Pair implements Comparable<Pair> {
    public int x;
    public int y;

    public Pair(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int toIndex(int base) {
        return this.x * base + this.y;
    }

    public List<Pair> neighbors() {
        List<Pair> ans = new ArrayList<>();
        ans.add(new Pair(this.x + 1, this.y));
        ans.add(new Pair(this.x - 1, this.y));
        ans.add(new Pair(this.x, this.y + 1));
        ans.add(new Pair(this.x, this.y - 1));

        return ans;
    }

    @Override
    public int compareTo(Pair o) {
        if (o.x != this.x) {
            return this.x - o.x;
        } else {
            return this.y - o.y;
        }
    }

    @Override
    public int hashCode() {
        int v = this.x * 100000 + this.y;
        return Integer.hashCode(v);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Pair) {
            Pair op = (Pair) obj;
            return op.x == this.x && op.y == this.y;
        }

        return false;
    }
}


import java.io.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
//    ScanReader scanner = new ScanReader(System.in);
    Scanner scanner = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    solve(scanner, out);
    out.close();
  }

  final static int MAXN = 5 * 1000000 + 5;
  final static int MAXK = 505;
  static int N = 0;
  static int M = 0;
  static int K = 0;
  static int W = 0;
  static int H = 0;
  static int[][] A;
  static long[][] dp;
  static int[][] pre;
  static int[][] g;
  static int curAns = Integer.MAX_VALUE;
  static long[] HASH = new long[MAXN];
  static long MOD = (1L << 50) + 7;

  static void solve(Scanner scanner, PrintWriter out) {
    N = scanner.nextInt();
    M = scanner.nextInt();
    A = new int[N][M];
    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String line = scanner.nextLine();
      for (int j = 0; j < M; j++) {
        A[i][j] = line.charAt(j) == '1' ? 1 : 0;
      }
    }

    int[][] ones = new int[N][M];
    for (int ri = 0; ri < N; ri++) {
      int l = M - 1;
      int r = M - 1;
      while (l >= 0) {
        if (A[ri][l] == 0) {
          int count = r - l;
          for (int i = l + 1; i < r + 1; i++) {
            ones[ri][i] = count - (i - l - 1);
          }
          r = l - 1;
        }
        l--;
      }
      int count = r + 1;
      for (int i = 0; i < r + 1; i++) {
        ones[ri][i] = count - i;
      }
    }

    int ans = 0;
    int[] width = new int[N];
    for (int left = 0; left < M; left++) {
      for (int ri = 0; ri < N; ri++) {
        width[ri] = ones[ri][left];
      }
      Arrays.sort(width);

      for (int ri = 0; ri < N; ri++) {
        ans = Math.max(ans, (N-ri) * width[ri]);
      }
    }
    out.println(ans);
  }

  static class ScanReader {
    private byte[] buf = new byte[4 * 1024];
    private int index;
    private BufferedInputStream in;
    private int total;

    public ScanReader(InputStream inputStream) {
      in = new BufferedInputStream(inputStream);
    }

    private int scan() {
      if (index >= total) {
        index = 0;
        try {
          total = in.read(buf);
        } catch (Exception e) {
          e.printStackTrace();
        }
        if (total <= 0) return -1;
      }
      return buf[index++];
    }

    public int nextInt() {
      int integer = 0;
      int n = scan();
      while (isWhiteSpace(n)) n = scan();
      int neg = 1;
      if (n == '-') {
        neg = -1;
        n = scan();
      }
      while (!isWhiteSpace(n)) {
        if (n >= '0' && n <= '9') {
          integer *= 10;
          integer += n - '0';
          n = scan();
        }
      }
      return neg * integer;
    }

    private boolean isWhiteSpace(int n) {
      if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
      else return false;
    }

  }
}

class UnioinSet {
  private Map<Long, Long> parents = new HashMap<>();

  public Long find(Long u) {
    if (parents.getOrDefault(u, u).equals(u)) {
      return u;
    }

    return find(parents.get(u));
  }

  public void union(Long u, Long v) {
    Long pu = find(u);
    Long pv = find(v);

    parents.put(pu, pv);
  }
}

class Pair implements Comparable<Pair> {
  public int x;
  public int y;

  public Pair(int x, int y) {
    this.x = x;
    this.y = y;
  }

  public int toIndex(int base) {
    return this.x * base + this.y;
  }

  public List<Pair> neighbors() {
    List<Pair> ans = new ArrayList<>();
    ans.add(new Pair(this.x + 1, this.y));
    ans.add(new Pair(this.x - 1, this.y));
    ans.add(new Pair(this.x, this.y + 1));
    ans.add(new Pair(this.x, this.y - 1));

    return ans;
  }

  @Override
  public int compareTo(Pair o) {
    if (o.x != this.x) {
      return this.x - o.x;
    } else {
      return this.y - o.y;
    }
  }

  @Override
  public int hashCode() {
    int v = this.x * 100000 + this.y;
    return Integer.hashCode(v);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj instanceof Pair) {
      Pair op = (Pair) obj;
      return op.x == this.x && op.y == this.y;
    }

    return false;
  }
}


import java.io.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve();
  }

  final static int MAXN = 5 * 1000000 + 5;
  final static int MAXK = 505;
  static int N = 0;
  static int M = 0;
  static int K = 0;
  static int W = 0;
  static int H = 0;
  static int[][] A;
  static long[][] dp;
  static int[][] pre;
  static int[][] g;
  static int curAns = Integer.MAX_VALUE;
  static long[] HASH = new long[MAXN];
  static long MOD = (1L << 50) + 7;

  static void solve() {
    FastReader scanner = new FastReader();
    PrintWriter out = new PrintWriter(System.out);

    N = scanner.nextInt();
    M = scanner.nextInt();
    A = new int[N][M];

    for (int i = 0; i < N; i++) {
      char[] s = scanner.next().toCharArray();
      for (int j = 0; j < M; j++) {
        A[i][j] = s[j] - '0';
      }
    }

    for (int i = 0; i < N; i++) {
      for (int j = 1; j < M; j++) {
        if (A[i][j] != 0) {
          A[i][j] = A[i][j-1] + 1;
        }
      }
    }

    int[] height = new int[M+1];
    int ans = 0;
    for (int j = 0; j < M; j++) {
      for (int i = 0; i < N; i++) {
        height[A[i][j]] ++;
      }
      int sum = 0;
      for (int w = 0; w <= M; w++) {
        if (height[w] > 0) {
          ans = Math.max(ans, (M-sum) * w);
          sum += height[w];
          height[w] = 0;
        }
      }
    }
    out.println(ans);
    out.close();
  }

  public static class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
      br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
      while (st == null || !st.hasMoreTokens()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (Exception r) {
          r.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());//converts string to integer
    }

    double nextDouble() {
      return Double.parseDouble(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

    String nextLine() {
      String str = "";
      try {
        str = br.readLine();
      } catch (Exception r) {
        r.printStackTrace();
      }
      return str;
    }
  }
}

class UnioinSet {
  private Map<Long, Long> parents = new HashMap<>();

  public Long find(Long u) {
    if (parents.getOrDefault(u, u).equals(u)) {
      return u;
    }

    return find(parents.get(u));
  }

  public void union(Long u, Long v) {
    Long pu = find(u);
    Long pv = find(v);

    parents.put(pu, pv);
  }
}

class Pair implements Comparable<Pair> {
  public int x;
  public int y;

  public Pair(int x, int y) {
    this.x = x;
    this.y = y;
  }

  public int toIndex(int base) {
    return this.x * base + this.y;
  }

  public List<Pair> neighbors() {
    List<Pair> ans = new ArrayList<>();
    ans.add(new Pair(this.x + 1, this.y));
    ans.add(new Pair(this.x - 1, this.y));
    ans.add(new Pair(this.x, this.y + 1));
    ans.add(new Pair(this.x, this.y - 1));

    return ans;
  }

  @Override
  public int compareTo(Pair o) {
    if (o.x != this.x) {
      return this.x - o.x;
    } else {
      return this.y - o.y;
    }
  }

  @Override
  public int hashCode() {
    int v = this.x * 100000 + this.y;
    return Integer.hashCode(v);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj instanceof Pair) {
      Pair op = (Pair) obj;
      return op.x == this.x && op.y == this.y;
    }

    return false;
  }
}


import java.io.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
//    ScanReader scanner = new ScanReader(System.in);
    Scanner scanner = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    solve(scanner, out);
    out.close();
  }

  final static int MAXN = 5 * 1000000 + 5;
  final static int MAXK = 505;
  static int N = 0;
  static int M = 0;
  static int K = 0;
  static int W = 0;
  static int H = 0;
  static int[][] A;
  static long[][] dp;
  static int[][] pre;
  static int[][] g;
  static int curAns = Integer.MAX_VALUE;
  static long[] HASH = new long[MAXN];
  static long MOD = (1L << 50) + 7;

  static void solve(Scanner scanner, PrintWriter out) {
    N = scanner.nextInt();
    M = scanner.nextInt();
    A = new int[N][M];
    scanner.nextLine();
    for (int i = 0; i < N; i++) {
      String line = scanner.nextLine();
      for (int j = 0; j < M; j++) {
        A[i][j] = line.charAt(j) == '1' ? 1 : 0;
      }
    }

    int[][] ones = new int[N][M];
    for (int ri = 0; ri < M; ri++) {
      int l = M - 1;
      int r = M - 1;
      while (l >= 0) {
        if (A[ri][l] == 0) {
          int count = r - l;
          for (int i = l + 1; i < r + 1; i++) {
            ones[ri][i] = count - (i - l - 1);
          }
          r = l - 1;
        }
        l--;
      }
      int count = r + 1;
      for (int i = 0; i < r + 1; i++) {
        ones[ri][i] = count - i;
      }
    }

    int ans = 0;
    int[] width = new int[N];
    for (int left = 0; left < M; left++) {
      for (int ri = 0; ri < N; ri++) {
        width[ri] = ones[ri][left];
      }
      Arrays.sort(width);

      for (int ri = 0; ri < N; ri++) {
        ans = Math.max(ans, (N-ri) * width[ri]);
      }
    }
    out.println(ans);
  }

  static class ScanReader {
    private byte[] buf = new byte[4 * 1024];
    private int index;
    private BufferedInputStream in;
    private int total;

    public ScanReader(InputStream inputStream) {
      in = new BufferedInputStream(inputStream);
    }

    private int scan() {
      if (index >= total) {
        index = 0;
        try {
          total = in.read(buf);
        } catch (Exception e) {
          e.printStackTrace();
        }
        if (total <= 0) return -1;
      }
      return buf[index++];
    }

    public int nextInt() {
      int integer = 0;
      int n = scan();
      while (isWhiteSpace(n)) n = scan();
      int neg = 1;
      if (n == '-') {
        neg = -1;
        n = scan();
      }
      while (!isWhiteSpace(n)) {
        if (n >= '0' && n <= '9') {
          integer *= 10;
          integer += n - '0';
          n = scan();
        }
      }
      return neg * integer;
    }

    private boolean isWhiteSpace(int n) {
      if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
      else return false;
    }

  }
}

class UnioinSet {
  private Map<Long, Long> parents = new HashMap<>();

  public Long find(Long u) {
    if (parents.getOrDefault(u, u).equals(u)) {
      return u;
    }

    return find(parents.get(u));
  }

  public void union(Long u, Long v) {
    Long pu = find(u);
    Long pv = find(v);

    parents.put(pu, pv);
  }
}

class Pair implements Comparable<Pair> {
  public int x;
  public int y;

  public Pair(int x, int y) {
    this.x = x;
    this.y = y;
  }

  public int toIndex(int base) {
    return this.x * base + this.y;
  }

  public List<Pair> neighbors() {
    List<Pair> ans = new ArrayList<>();
    ans.add(new Pair(this.x + 1, this.y));
    ans.add(new Pair(this.x - 1, this.y));
    ans.add(new Pair(this.x, this.y + 1));
    ans.add(new Pair(this.x, this.y - 1));

    return ans;
  }

  @Override
  public int compareTo(Pair o) {
    if (o.x != this.x) {
      return this.x - o.x;
    } else {
      return this.y - o.y;
    }
  }

  @Override
  public int hashCode() {
    int v = this.x * 100000 + this.y;
    return Integer.hashCode(v);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj instanceof Pair) {
      Pair op = (Pair) obj;
      return op.x == this.x && op.y == this.y;
    }

    return false;
  }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
//    ScanReader scanner = new ScanReader(System.in);
        Scanner scanner = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(scanner, out);
        out.close();
    }

    final static int MAXN = 5 * 1000000 + 5;
    final static int MAXK = 505;
    static int N = 0;
    static int M = 0;
    static int K = 0;
    static int W = 0;
    static int H = 0;
    static int[][] A;
    static long[][] dp;
    static int[][] pre;
    static int[][] g;
    static int curAns = Integer.MAX_VALUE;
    static long[] HASH;
    static long MOD = (1L << 50) + 7;
    static int[] WC;

    static void solve(Scanner scanner, PrintWriter out) {
        N = scanner.nextInt();
        M = scanner.nextInt();
        A = new int[N][M];
        scanner.nextLine();
        for (int i = 0; i < N; i++) {
            String line = scanner.nextLine();
            for (int j = 0; j < M; j++) {
                A[i][j] = line.charAt(j) == '1' ? 1 : 0;
            }
        }

        int[][] ones = new int[N][M];
        for (int ri = 0; ri < N; ri++) {
            int count = 0;
            for (int c = M-1; c >= 0 ; c--) {
                if (A[ri][c] == 0) {
                    count = 0;
                } else {
                    count++;
                    ones[ri][c] = count;
                }
            }
        }

        int ans = 0;
        int[] width = new int[M+1];
        for (int left = 0; left < M; left++) {
            Arrays.fill(width, 0);
            for (int ri = 0; ri < N; ri++) {
                width[ones[ri][left]] += 1;
            }
            int lower = 0;
            for (int w = 0; w <= M; w++) {
                int h = N - lower;
                ans = Math.max(ans, w * h);
                lower += width[w];
                if (lower >= N) {
                    break;
                }
            }
        }
        out.println(ans);
    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int nextInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}

class UnioinSet {
    private Map<Long, Long> parents = new HashMap<>();

    public Long find(Long u) {
        if (parents.getOrDefault(u, u).equals(u)) {
            return u;
        }

        return find(parents.get(u));
    }

    public void union(Long u, Long v) {
        Long pu = find(u);
        Long pv = find(v);

        parents.put(pu, pv);
    }
}

class Pair implements Comparable<Pair> {
    public int x;
    public int y;

    public Pair(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int toIndex(int base) {
        return this.x * base + this.y;
    }

    public List<Pair> neighbors() {
        List<Pair> ans = new ArrayList<>();
        ans.add(new Pair(this.x + 1, this.y));
        ans.add(new Pair(this.x - 1, this.y));
        ans.add(new Pair(this.x, this.y + 1));
        ans.add(new Pair(this.x, this.y - 1));

        return ans;
    }

    @Override
    public int compareTo(Pair o) {
        if (o.x != this.x) {
            return this.x - o.x;
        } else {
            return this.y - o.y;
        }
    }

    @Override
    public int hashCode() {
        int v = this.x * 100000 + this.y;
        return Integer.hashCode(v);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Pair) {
            Pair op = (Pair) obj;
            return op.x == this.x && op.y == this.y;
        }

        return false;
    }
}