#include <bits/stdc++.h>
using namespace std;
bool vis[8];
list<long long> graph[8], newgraph[8];
map<pair<long long, long long>, long long> mp;
map<long long, long long> check;
map<pair<long long, long long>, long long> edges;
long long ans = 0;
void dfs(long long x, list<long long>* graph) {
  vis[x] = 1;
  bool flag = 0;
  for (auto y : graph[x]) {
    if (!vis[y]) {
      if (mp.find({min(check[y], check[x]), max(check[y], check[x])}) !=
          mp.end()) {
      } else {
        mp[{min(check[y], check[x]), max(check[y], check[x])}]++;
        ans++;
      }
    }
  }
  for (auto y : graph[x]) {
    if (!vis[y]) {
      dfs(y, graph);
    }
  }
}
void dfs(long long x) {
  vis[x] = 1;
  for (auto y : graph[x]) {
    if (!vis[y]) dfs(y);
  }
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  long long u, v;
  for (long long i = 0; i < m; i++) {
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
    edges[{min(u, v), max(u, v)}]++;
  }
  long long count = 1;
  check[1] = 1;
  check[2] = 2;
  check[3] = 3;
  check[4] = 4;
  check[5] = 5;
  check[6] = 6;
  long long res = 0;
  if (n == 7) {
    long long temp = -1;
    for (long long i = 1; i <= 7; i++) {
      if (!vis[i]) {
        dfs(i);
        temp++;
      }
    }
    for (long long i = 1; i <= 6; i++) {
      for (long long j = i + 1; j <= 7; j++) {
        check[i] = check[j] = 1;
        count = 2;
        for (long long k = 1; k <= 7; k++) {
          if (k == i or k == j) {
          } else
            check[k] = count++;
        }
        ans = 0;
        mp.clear();
        memset(vis, 0, sizeof(vis));
        for (long long k = 1; k <= 7; k++) {
          if (!vis[k]) dfs(k, graph);
        }
        res = max(ans, res);
      }
    }
    cout << res;
    return 0;
  } else {
  }
  for (long long k = 1; k <= 7; k++) {
    if (!vis[k]) dfs(k, graph);
  }
  cout << ans;
}
