#include <bits/stdc++.h>
using namespace std;
vector<short int> Neighbs[7];
int main() {
  short int n, m;
  scanf("%hi%hi", &n, &m);
  for (short int i = 0; i < m; i++) {
    short int a, b;
    scanf("%hi%hi", &a, &b);
    a--, b--;
    Neighbs[a].push_back(b);
    Neighbs[b].push_back(a);
  }
  if (n < 7) {
    printf("%hi", m);
  } else {
    short int minLostNum = 7;
    for (short int i = 0; i < n; i++) {
      for (short int j = 0; j < n; j++) {
        if (j == i) continue;
        short int loc = 0;
        for (auto it1 : Neighbs[i])
          for (auto it2 : Neighbs[j])
            if (it1 == it2) loc++;
        if (loc < minLostNum) minLostNum = loc;
      }
    }
    printf("%hi", m - minLostNum);
  }
}
