#include <bits/stdc++.h>
using namespace std;
bool mp[9][9];
int n, m, x, y;
struct node {
  int id, num;
  friend bool operator<(node a, node b) { return a.num < b.num; }
} cd[9];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cd[i].id = i;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    mp[x][y] = 1;
    mp[y][x] = 1;
    cd[x].num++;
    cd[y].num++;
  }
  x = 0;
  y = m;
  if (n == 7) {
    for (int i = 1; i < 7; i++)
      for (int j = 1 + i; j <= 7; j++) {
        x = 0;
        for (int k = 1; k <= 7; k++)
          if (mp[k][i] && mp[j][k]) x++;
        y = min(y, x);
      }
    m -= y;
  }
  cout << m << endl;
  return 0;
}
