#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> v[8];
int solve(int k) {
  int vis[n + 1][n + 1];
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) vis[i][j] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < v[i].size(); j++)
      if (v[i][j] != k && i != k) {
        vis[i][v[i][j]] = 1;
        vis[v[i][j]][i] = 1;
      }
  }
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    if (i != k)
      for (int j = 0; j < v[k].size(); j++)
        if (!vis[i][v[k][j]]) {
          cnt++;
        }
    mx = max(cnt, mx);
  }
  return mx;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  if (n <= 6)
    cout << m;
  else if (n == 7 && v[7].size() == 0)
    cout << m;
  else {
    int mx = 0;
    for (int i = 1; i <= n; i++) {
      int cnt;
      cnt = solve(i);
      int len = v[i].size();
      mx = max(mx, m - len + cnt);
    }
    cout << mx << endl;
  }
}
