#include <bits/stdc++.h>
using namespace std;
int mp[10][10];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    mp[x][y] = mp[y][x] = 1;
  }
  if (n <= 6) {
    cout << m << "\n";
  } else {
    int t = 1000;
    for (int i = 1; i < 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        int c = 0;
        for (int k = 1; k <= 7; k++) {
          if (mp[i][k] && mp[j][k]) {
            c++;
          }
        }
        t = min(c, t);
      }
    }
    printf("%d\n", m - t);
  }
}
