#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> adj[8];
  long long a[8][8] = {0};
  long long n, e;
  cin >> n >> e;
  for (long long i = 0; i < e; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
    a[x][y] = 1;
    a[y][x] = 1;
  }
  if (n < 7) {
    cout << e << endl;
  } else {
    long long max = 0, max_ind = 1;
    for (long long i = 1; i <= 7; i++) {
      for (long long j = 1; j <= 7; j++) {
        long long val = 0;
        if (j != i) {
          for (long long k = 0; k < adj[i].size(); k++) {
            if (a[j][adj[i][k]] == 0) val++;
          }
        }
        if ((e - adj[i].size() + val) > (e - adj[max_ind].size() + max)) {
          max = val;
          max_ind = i;
        }
      }
    }
    cout << e - adj[max_ind].size() + max << endl;
  }
  return 0;
}
