#include <bits/stdc++.h>
using namespace std;
bool a[8][8];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    a[x][y] = true, a[y][x] = true;
  }
  if (n <= 6) {
    cout << m;
    return 0;
  }
  int sub = -1;
  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 (a[i][k] && a[j][k]) cnt++;
      }
      if (sub == -1 || sub > cnt) sub = cnt;
    }
  }
  cout << m - sub;
  return 0;
}
