You are given a table consisting of n rows and m columns. Each cell of the table contains either 0 or 1. In one move, you are allowed to pick any row or any column and invert all values, that is, replace 0 by 1 and vice versa.

What is the minimum number of cells with value 1 you can get after applying some number of operations?

Input

The first line of the input contains two integers n and m (1 ≤ n ≤ 20, 1 ≤ m ≤ 100 000) — the number of rows and the number of columns, respectively.

Then n lines follows with the descriptions of the rows. Each line has length m and contains only digits '0' and '1'.

Output

Output a single integer — the minimum possible number of ones you can get after applying some sequence of operations.

Example

Input

3 4
0110
1010
0111


Output

2
#include <bits/stdc++.h>
const int mod = 1000000007;
const int inf = 1000000009;
const long long INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.0000000001;
using namespace std;
int T[21][100005], C[100005];
long long int DP[(1 << 20)][21];
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 1; j <= m; j++) {
      char c;
      cin >> c;
      T[i][j] = c - '0';
    }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < n; j++) {
      if (T[j][i]) C[i] += (1 << j);
    }
    DP[C[i]][0]++;
  }
  int wynik = inf;
  for (int j = 1; j <= n; j++) {
    for (int i = 0; i < (1 << n); i++) {
      if (j >= 2) DP[i][j] += (long long int)(j - 2 - n) * DP[i][j - 2];
      for (int k = 0; k < n; k++) DP[i][j] += DP[i ^ (1 << k)][j - 1];
      DP[i][j] /= j;
    }
  }
  for (int i = 0; i < (1 << n); i++) {
    int aktual = 0;
    for (int j = 0; j <= n; j++) aktual += DP[i][j] * min(j, n - j);
    wynik = min(wynik, aktual);
  }
  cout << wynik;
  return 0;
}
