#include <bits/stdc++.h>
using namespace std;
long long arr[8][8], i, j, k, n, m, mini = 10000, cnt = 0, a, b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> a >> b;
    arr[a][b] = 1;
    arr[b][a] = 1;
  }
  if (n <= 6) {
    cout << m;
    return 0;
  }
  for (i = 1; i <= 7; i++) {
    for (j = 1; j <= 7; j++) {
      cnt = 0;
      for (k = 1; k <= 7; k++) {
        if (arr[i][k] && arr[j][k]) cnt++;
      }
      mini = min(mini, cnt);
    }
  }
  cout << m - mini;
}
