#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, t, a, b;
  scanf("%lld %lld %lld %lld", &n, &t, &a, &b);
  vector<pair<long long, long long> > v(n);
  vector<int> h(n);
  int cnte = 0;
  int cnth = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &h[i]);
    if (h[i]) {
      cnth++;
    } else
      cnte++;
  }
  for (int i = 0; i < n; i++) {
    scanf("%lld", &v[i].first);
    v[i].second = h[i];
  }
  v.push_back({t + 1, 0});
  sort(v.begin(), v.end());
  long long cnt1 = 0;
  long long cnt2 = 0;
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    long long need = cnt1 * a + cnt2 * b;
    long long has = v[i].first - 1 - need;
    if (has >= 0) {
      long long cane = min((cnte - cnt1), has / a);
      has -= cane * a;
      long long canh = min((cnth - cnt2), has / b);
      ans = max(ans, cnt1 + cnt2 + cane + canh);
    }
    int l = i;
    while (l < v.size() && v[l].first == v[i].first) {
      if (v[l].second) {
        cnt2++;
      } else {
        cnt1++;
      }
      l++;
    }
    i = l - 1;
  }
  printf("%lld\n", ans);
}
int g[8][8];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u][v] = g[v][u] = 1;
  }
  if (n <= 6) {
    printf("%d", m);
  } else {
    int ans = INT_MAX;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        int res = 0;
        for (int k = 1; k <= n; k++) {
          if (g[i][k] && g[k][j]) res++;
        }
        ans = min(ans, res);
      }
    }
    printf("%d", m - ans);
  }
  return 0;
}
