#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long power(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b == 1) {
    return a;
  } else if (b & 1) {
    return (a % mod * power((a % mod * a % mod) % mod, b / 2)) % mod;
  } else {
    return (power((a % mod * a % mod) % mod, b / 2)) % mod;
  }
}
void generate_label(vector<vector<int> > &arr, vector<int> &label) {
  if (label.size() == 7) {
    arr.push_back(label);
    return;
  }
  for (int j = 1; j <= 6; j++) {
    label.push_back(j);
    generate_label(arr, label);
    label.pop_back();
  }
}
void solve1(int n, vector<int> adj[]) {
  vector<vector<int> > arr;
  vector<int> label;
  generate_label(arr, label);
  int maxi = 0;
  for (int i = 0; i < arr.size(); i++) {
    set<int> first;
    first.insert(arr[i].begin(), arr[i].end());
    if (first.size() == 6) {
      int m = 0;
      bool isok = true;
      map<pair<int, int>, bool> mp;
      for (int j = 1; j <= n; j++) {
        for (int k : adj[j]) {
          if (mp[{arr[i][j - 1], arr[i][k - 1]}]) {
            continue;
          } else {
            mp[{arr[i][j - 1], arr[i][k - 1]}] = 1;
            mp[{arr[i][k - 1], arr[i][j - 1]}] = 1;
            m++;
          }
        }
      }
      maxi = max(maxi, m);
    }
  }
  cout << maxi << endl;
}
void solve() {
  int n, m, a, b;
  cin >> n >> m;
  vector<int> adj[n + 1];
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  if (m == 0) {
    cout << 0 << endl;
    return;
  } else if (n <= 6) {
    cout << m << endl;
    return;
  } else {
    solve1(n, adj);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
