#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, nap[8][8], x, y;
  while (cin >> n >> m) {
    memset(nap, 0, sizeof nap);
    for (int i = 0; i < m; i++) {
      cin >> x >> y;
      nap[x][y] = 1;
      nap[y][x] = 1;
    }
    int cnt;
    int ans = 0x3f3f3f3f;
    if (n < 7)
      cout << m << endl;
    else {
      for (int i = 1; i <= n; i++)
        for (int j = i + 1; j <= n; j++) {
          cnt = 0;
          for (int k = 1; k <= n; k++)
            if (nap[i][k] && nap[j][k]) {
              cnt++;
            }
          ans = min(ans, cnt);
        }
      cout << m - ans << endl;
    }
  }
}
