#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 8;
set<int> adj[N];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].insert(y);
    adj[y].insert(x);
  }
  if (n <= 6)
    cout << m;
  else {
    int ans = 0;
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        int mx = m;
        for (int k = 1; k <= 7; k++) {
          if (k == i or k == j) continue;
          if (adj[i].find(k) != adj[i].end() and adj[j].find(k) != adj[j].end())
            mx--;
        }
        ans = max(ans, mx);
      }
    }
    cout << ans;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
