#include <bits/stdc++.h>
using namespace std;
int d[10][10];
int main() {
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    d[a][b] = 1;
    d[b][a] = 1;
  }
  if (n < 7) {
    cout << m << endl;
  } else {
    int ans = 0x3f3f3f3f;
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        int cnt = 0;
        for (int k = 1; k <= 7; k++) {
          if (d[i][k] && d[j][k]) cnt++;
        }
        ans = min(ans, cnt);
      }
    }
    cout << m - ans << endl;
  }
  return 0;
}
