#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> graph;
int main() {
  int n, m;
  cin >> n >> m;
  set<pair<int, int>> edges;
  graph.resize(n, vector<int>(n, 0));
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    if (a > b) swap(a, b);
    edges.insert({a, b});
  }
  if (n < 7)
    cout << m;
  else {
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        set<pair<int, int>> edge;
        for (auto it : edges) {
          if (it.first == j) {
            edge.insert({i, it.second});
          } else if (it.second == j) {
            if (i < it.first) {
              edge.insert({i, it.first});
            } else {
              edge.insert({it.first, i});
            }
          } else {
            edge.insert(it);
          }
        }
        ans = max(ans, (int)edge.size());
      }
    }
    cout << ans;
  }
}
