#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, x, y, s = 0, cnt = 0, ans = 10, i, j, k, l;
  vector<long long int> a[7];
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    a[x - 1].push_back(y);
    a[y - 1].push_back(x);
  }
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      cnt = 0;
      for (k = 0; k < a[i].size(); k++) {
        for (l = 0; l < a[j].size(); l++)
          if (a[i][k] == a[j][l]) {
            cnt++;
            break;
          }
      }
      ans = min(ans, cnt);
    }
  }
  for (i = 0; i < n; i++) {
    s += a[i].size();
  }
  ans = (s - 2 * ans) / 2;
  cout << ans << endl;
  return 0;
}
