#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n < 7) {
    cout << m;
    return 0;
  }
  int i, j;
  vector<vector<int> > a(7, vector<int>());
  for (i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  set<int> s;
  for (i = 1; i <= 6; i++) s.insert(i);
  int mini = 50;
  int col[7];
  for (int x = 0; x < n; x++) {
    for (int y = x + 1; y < n; y++) {
      int k = 2;
      for (i = 0; i < n; i++) col[i] = (i == x || i == y) ? 1 : k++;
      int c = 0;
      set<int> curr = s;
      for (auto i : a[x]) {
        if (curr.count(col[i]))
          curr.erase(col[i]);
        else
          c++;
      }
      for (auto i : a[y]) {
        if (curr.count(col[i]))
          curr.erase(col[i]);
        else if (i != x)
          c++;
      }
      mini = min(mini, c);
    }
  }
  cout << m - mini << '\n';
}
