#include <bits/stdc++.h>
using namespace std;
mt19937 rnd;
const int maxn = 9;
int n, m;
vector<int> g[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (n <= 6) {
    cout << m << '\n';
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    vector<int> cnt;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      bool adj = 0;
      for (int to : g[j]) {
        if (to == i) adj = 1;
      }
      if (adj) {
        cnt.push_back(g[j].size() - 1);
      } else {
        cnt.push_back(g[j].size());
      }
    }
    int sum = 0;
    for (int i = 0; i < cnt.size(); i++) sum += cnt[i];
    sum /= 2;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      int kek = 0;
      for (int ti : g[i]) {
        for (int tj : g[j]) {
          if (ti == tj) {
            kek++;
          }
        }
      }
      int lol = g[i].size();
      ans = max(ans, sum + lol - kek);
    }
  }
  cout << ans;
  return 0;
}
