#include <bits/stdc++.h>
using namespace std;
int a[10], mp[10][10];
int main() {
  int n, m, x, y;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    mp[x][y] = mp[y][x] = 1;
  }
  if (n <= 6)
    cout << m << endl;
  else {
    int ans = 1000;
    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 (mp[i][k] && mp[j][k]) cnt++;
        ans = min(ans, cnt);
      }
    }
    cout << m - ans << endl;
  }
}
