#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> edge;
int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  edge.resize(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  if (n != 7)
    cout << m << '\n';
  else {
    int mx = 0;
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        int h = 0, k = 0;
        for (int f = 0; f < edge[i].size(); f++) h += (1 << edge[i][f]);
        for (int f = 0; f < edge[j].size(); f++) k += (1 << edge[j][f]);
        int same = h & k, cnt = 0;
        while (same > 0) {
          cnt++;
          same -= (same & (-same));
        }
        mx = max(mx, m - cnt);
      }
    }
    cout << mx << '\n';
  }
  return 0;
}
