#include <bits/stdc++.h>
using namespace std;
int n, m, u, v, ans;
vector<int> g[10];
bool vis[10];
set<pair<int, int> > st;
int asg[10];
void dfs(int s) {
  vis[s] = true;
  for (int i = 0; i < g[s].size(); i++) {
    if (!vis[g[s][i]]) dfs(g[s][i]);
    st.insert({min(asg[s], asg[g[s][i]]), max(asg[s], asg[g[s][i]])});
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= 6; i++) asg[i] = i;
  if (n <= 6) {
    for (int i = 1; i <= n; i++)
      if (!vis[i]) dfs(i);
    ans = int(st.size());
  } else {
    for (int x = 1; x <= n; x++) {
      for (int y = x + 1; y <= n; y++) {
        asg[x] = asg[y] = 1;
        for (int i = 1, j = 2; i <= n; i++, j++) {
          if (i != x && i != y) asg[i] = j;
        }
        for (int i = 1; i <= n; i++)
          if (!vis[i]) dfs(i);
        ans = max(ans, int(st.size()));
        for (int i = 1; i <= n; i++) vis[i] = false;
        st.clear();
      }
    }
  }
  cout << ans << endl;
}
