#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int graph[8][8] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a][b] = 1;
    graph[b][a] = 1;
  }
  if (n <= 6 or m == 0) {
    cout << m << endl;
    return 0;
  }
  int ans = 999;
  for (int i = 1; i < 7; i++) {
    for (int j = i + 1; j <= 7; j++) {
      int now = 0;
      for (int k = 1; k <= 7; k++)
        if (graph[i][k] and graph[j][k]) now++;
      ans = min(ans, now);
    }
  }
  cout << m - ans << endl;
}
