#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  cin >> n >> m;
  if (n < 7) {
    cout << m << endl;
    return 0;
  }
  vector<vector<int>> edge(8);
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  int anw = 0;
  for (int j = 0; j < 6; ++j) {
    int answ = 0;
    for (int i = 0; i < 6; ++i) {
      if (j != i) {
        int t = 0;
        for (auto v : edge[j + 1]) {
          if (find(edge[i + 1].begin(), edge[i + 1].end(), v) ==
              edge[i + 1].end())
            ++t;
        }
        answ = max(answ, t);
      }
    }
    int p = m - edge[j + 1].size() + answ;
    anw = max(anw, p);
  }
  cout << anw << endl;
  return 0;
}
