#include <bits/stdc++.h>
using namespace std;
bool disconnected(vector<int> adj[], int n) {
  vector<bool> visit(n + 1, false);
  queue<int> q;
  q.push(1);
  visit[1] = true;
  vector<int>::iterator it;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (it = adj[v].begin(); it != adj[v].end(); it++) {
      if (visit[*it] == false) {
        q.push(*it);
        visit[*it] = true;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (visit[i] == false) return true;
  }
  return false;
}
int main() {
  int n, ed;
  cin >> n >> ed;
  int x, y;
  vector<int> adj[n + 1];
  for (int i = 0; i < ed; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int ans = ed;
  if (n != 7 || disconnected(adj, n)) {
    cout << ans << endl;
    return 0;
  }
  ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int m = 1; m <= n; m++) {
      if (i == m) continue;
      set<int> s;
      for (int j = 1; j <= n; j++) {
        for (int k = 0; k < adj[j].size(); k++) {
          int x, y, z, p;
          x = (j == i) ? m : j;
          y = adj[j][k] == i ? m : adj[j][k];
          z = min(x, y);
          p = max(x, y);
          s.insert(z * n + p);
        }
      }
      int sz = s.size();
      ans = max(ans, sz);
    }
  }
  cout << ans << endl;
  return 0;
}
