#include <bits/stdc++.h>
using namespace std;
int v[7][7];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    v[a][b]++;
    v[b][a]++;
  }
  if (n <= 6) {
    cout << m;
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int temp = m;
      for (int k = 1; k <= n; k++) {
        if (k != i && k != j && v[i][k] && v[j][k]) temp--;
      }
      ans = max(ans, temp);
    }
  }
  cout << ans;
  return 0;
}
