#include <bits/stdc++.h>
using namespace std;
int mp[30][30];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    mp[a][b] = mp[b][a] = 1;
  }
  if (n <= 6)
    cout << m << endl;
  else {
    int ans = 0x3f3f3f3f;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        int cnt = 0;
        for (int k = 1; k <= n; k++) {
          if (mp[i][k] && mp[j][k]) cnt++;
        }
        ans = min(ans, cnt);
      }
    }
    cout << m - ans << endl;
  }
  return 0;
}
