#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, siz = 3e5 + 5;
long long n, m, a[siz], deg[11], adj[11][11];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x][y] = adj[y][x] = 1;
    deg[x]++;
    deg[y]++;
  }
  if (n <= 6) return cout << m << endl, 0;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long cur = 0;
    for (long long j = 1; j <= n; j++) {
      long long t = 0;
      for (long long k = 1; k <= n; k++) {
        if (adj[i][k] and !adj[j][k]) t++;
      }
      cur = max(cur, t);
    }
    ans = max(ans, m - deg[i] + cur);
  }
  cout << ans << endl;
}
