#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  int graph[10][10] = {{0, 0}};
  for (int i = 0; i < k; i++) {
    long long l, r;
    cin >> l >> r;
    graph[l][r] = 1;
    graph[r][l] = 1;
  }
  if (n <= 6)
    cout << k << endl;
  else {
    int ans = 0;
    for (int i = 1; i < n + 1; i++) {
      for (int j = i + 1; j < n + 1; j++) {
        int temp = k;
        for (int k = 0; k < n + 1; k++) {
          if (k != i && k != j) {
            if (graph[i][k] == 1 && graph[k][j] == 1) temp--;
          }
        }
        ans = max(ans, temp);
      }
    }
    cout << ans << endl;
  }
}
