#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 2e5 + 10;
bitset<10> b[10];
int main() {
  int n, m;
  cin >> n >> m;
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    b[x][y] = 1;
    b[y][x] = 1;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      bitset<10> bb = b[i] & b[j];
      ans = max(ans, m - (int)bb.count());
    }
  }
  cout << ans << endl;
  return 0;
}
