#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const int LOGN = 20;
vector<int> g[8];
bool domino[7][7];
int pl[7];
int n, m;
int ans = 0;
void dfs(int now) {
  if (now != n) {
    for (int i = 1; i <= 6; ++i) {
      pl[now] = i;
      dfs(now + 1);
    }
  } else {
    int cnt = 0;
    memset(domino, false, sizeof(domino));
    for (int i = 1; i <= n; ++i) {
      for (int j = 0; j < g[i].size(); ++j) {
        int u = i, v = g[i][j];
        if (!domino[pl[u - 1]][pl[v - 1]] || !domino[pl[v - 1]][pl[u - 1]]) {
          domino[pl[u - 1]][pl[v - 1]] = domino[pl[v - 1]][pl[u - 1]] = true;
          cnt++;
        }
      }
    }
    ans = max(ans, cnt);
  }
}
signed main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
  }
  dfs(0);
  printf("%d\n", ans);
  return 0;
}
