#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};
const int INF = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
int n, m;
bool adj[8][8];
int cnt[7][7];
int color[8];
bool v[8];
int pp(int x) {
  int ret = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (adj[i][j] == 0) continue;
      if (cnt[color[i]][color[j]]) {
        ret++;
        cnt[color[i]][color[j]]--;
      }
    }
  }
  return ret;
}
int solve(int x) {
  if (x > n) {
    for (int i = 1; i <= 6; i++) {
      for (int j = i; j <= 6; j++) {
        cnt[i][j] = 1;
      }
    }
    int ret = 0;
    for (int i = 1; i <= n; i++) {
      ret = max(ret, pp(i));
    }
    return ret;
  }
  int ret = 0;
  for (int i = 1; i <= 6; i++) {
    color[x] = i;
    ret = max(ret, solve(x + 1));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  while (m--) {
    int a, b;
    cin >> a >> b;
    adj[a][b] = adj[b][a] = 1;
  }
  color[1] = 1;
  cout << solve(2);
}
