#include <bits/stdc++.h>
using namespace std;
int c[7][7];
void solve() {
  int n, m;
  cin >> n >> m;
  if (n < 7) {
    cout << m;
    return;
  };
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    c[a][b] = 1;
    c[b][a] = 1;
  }
  vector<int> x(n, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      x[j] += c[i][j];
    }
  }
  int best = -INT_MAX;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) break;
      int p = 0;
      for (int z = 0; z < n; z++) {
        if (c[i][z] == 1 && c[j][z] == 0) p++;
      }
      best = max(best, -x[i] + p);
    }
  }
  cout << m + best;
}
int main() {
  solve();
  getchar();
  getchar();
}
