#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<vector<int>> grafo(n);
  for (int i = 0; i < m; i++) {
    int v1, v2;
    scanf("%d %d", &v1, &v2);
    v1--;
    v2--;
    grafo[v1].push_back(v2);
    grafo[v2].push_back(v1);
  }
  if (n < 7) {
    printf("%d\n", m);
  } else {
    int resp = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i == j) continue;
        int atual = m;
        for (auto v1 : grafo[i]) {
          for (auto v2 : grafo[j]) {
            if (v1 == v2) atual--;
          }
        }
        resp = max(atual, resp);
      }
    }
    printf("%d\n", resp);
  }
  return 0;
}
