#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  cin >> n >> m;
  if (n < 7) {
    cout << m;
    return 0;
  }
  vector<vector<bool>> graph(n, vector<bool>(n, false));
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    graph[a - 1][b - 1] = graph[b - 1][a - 1] = true;
  }
  a = 11;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      b = 0;
      for (int k = 0; k < n; ++k) {
        if (graph[i][k] && graph[j][k]) {
          ++b;
        }
      }
      a = min(a, b);
      if (!a) {
        break;
      }
    }
  }
  cout << m - a;
  return 0;
}
