#include <bits/stdc++.h>
using namespace std;
long long n, m, u, v, ans;
vector<vector<bool>> adj(1000, vector<bool>(1000, false));
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> u >> v;
    adj[u][v] = true;
    adj[v][u] = true;
  }
  ans = m;
  long long min1 = 10, cnt;
  if (n == 7) {
    for (int i = 1; i <= n; ++i) {
      for (int j = i + 1; j <= n; ++j) {
        cnt = 0;
        for (int k = 1; k <= n; ++k) {
          if (k == i || k == j) continue;
          if (adj[i][k] == 1 && adj[j][k] == 1) cnt++;
        }
        min1 = min(min1, cnt);
      }
    }
    ans -= min1;
  }
  cout << ans << endl;
}
