#include <bits/stdc++.h>
using namespace std;
int n, m;
int cnt[9], tot;
int edge[9][9];
int solve(int x) {
  int ret = 0;
  for (int i = 1; i <= 7; i++) {
    if (i == x) continue;
    int cnt = 0;
    for (int j = 1; j <= 7; j++) {
      if (edge[x][j] && edge[j][i] == 0) cnt++;
    }
    ret = max(ret, cnt);
  }
  return ret;
}
int main(void) {
  int x, y;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    cnt[x]++;
    cnt[y]++;
    tot++;
    edge[x][y] = edge[y][x] = 1;
  }
  if (n < 7) {
    cout << tot;
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= 7; i++) {
    ans = max(ans, tot - cnt[i] + solve(i));
  }
  cout << ans;
  return 0;
}
