#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int countMaxDom(int m, pair<int, int> edges[], int assignedVal[]) {
  int dominoesChosen[7][7];
  memset(dominoesChosen, 0, sizeof(dominoesChosen));
  int dominoesPut = 0;
  for (int i = 0; i < m; i++) {
    int a = assignedVal[edges[i].first];
    int b = assignedVal[edges[i].second];
    if (dominoesChosen[a][b] == 1 || dominoesChosen[b][a] == 1) continue;
    dominoesChosen[a][b] = 1;
    ++dominoesPut;
  }
  return dominoesPut;
}
int main() {
  int n, m;
  pair<int, int> edges[30];
  int assignedVal[10];
  cin >> n >> m;
  memset(edges, 0, sizeof(edges));
  for (int i = 0; i < m; ++i) {
    cin >> edges[i].first >> edges[i].second;
  }
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  int maxSoFar = 0;
  for (int wildnum = 1; wildnum <= 6; wildnum++) {
    for (int i = 1; i < 7; ++i) {
      assignedVal[i] = i;
    }
    assignedVal[7] = wildnum;
    sort(assignedVal + 1, assignedVal + 8);
    while (next_permutation(assignedVal + 1, assignedVal + 8)) {
      maxSoFar = max(countMaxDom(m, edges, assignedVal), maxSoFar);
    }
  }
  cout << maxSoFar << endl;
}
