#include <bits/stdc++.h>
using namespace std;
bool edge[10][10];
int cnt[10];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    edge[u][v] = edge[v][u] = 1;
    cnt[u]++, cnt[v]++;
  }
  if (n < 7) {
    cout << m << endl;
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int cur = 0;
      for (int l = 1; l <= n; l++) {
        if (l == i || l == j) continue;
        for (int r = 1; r <= n; r++) {
          if (r == i || r == j) continue;
          if (edge[l][r]) cur++;
        }
      }
      cur /= 2;
      set<int> st;
      for (int l = 1; l <= n; l++)
        if (edge[i][l]) st.insert(l);
      for (int l = 1; l <= n; l++)
        if (edge[j][l]) st.insert(l);
      cur += st.size();
      if (edge[i][j]) cur--;
      ans = max(ans, cur);
    }
  }
  cout << ans << endl;
}
